Rightward Assignment in Ruby - Day 04 - Advent of Code 2023
Вставка
- Опубліковано 26 сер 2024
- Dive into the Advent of Code 2023 Day 4 puzzle with a Ruby twist! In this episode, titled "Scratch Cards," we’ll focus on harnessing the power of Ruby's rightward assignment feature for a challenge.
We start by setting up our input data, consisting of winning numbers and our own numbers, separated by a pipe operator. The goal is to determine how often our numbers appear in the winning numbers, with points doubling for each match. This episode walks you through each process step, from parsing the input with here-docs to utilizing rightward assignment for efficient code structuring.
Our journey includes pattern matching and array manipulation. The second part of the puzzle adds a twist, where scratch cards yield more cards instead of points, leading to a cascading effect in card duplication.
Advent of Code: adventofcode.com/
My Solutions: gist.github.co...
Playlist • Advent of Code
#adventofcode #ruby
nice to see such videos, keep putting new things here
Thanks for watching!
*U have very BIG monitor*
*but very very very SMALL font*