I just completed "Garden Groups" - Day 12 - Advent of Code 2024 #AdventOfCode in #ruby, this one eluded me on first try, but after abandoning the 3x3 bounding box check for 4 2x2 corner checks I was able to express the solution in 20 lines with mostly one-line methods.
You can peek if you don't mind spoilers: https://gitlab.com/oinak/advent-of-code-2024/-/blob/main/day12/garden_groups.rb?ref_type=heads#L29-51
=> More informations about this toot | View the thread
I just completed "Claw Contraption" - Day 13 - Advent of Code 2024 #AdventOfCode in #ruby
Today I knew it was a 2D equation system, but could not remember the maths so I had to look it up.
You cab get it from me if you are looking too: https://gitlab.com/oinak/advent-of-code-2024/-/tree/main/day13
=> More informations about this toot | View the thread
I just completed "Plutonian Pebbles" - Day 11 - Advent of Code 2024 #AdventOfCode on #ruby
The shortest, most terse code of the year so far, very happy with the result, both parts run in 0.2s
You can have a peek if you don't mind spoilers: https://gitlab.com/oinak/advent-of-code-2024/-/tree/main/day11
=> More informations about this toot | View the thread
I just completed "Hoof It" - Day 10 - Advent of Code 2024 #AdventOfCode in #ruby https://gitlab.com/oinak/advent-of-code-2024/-/tree/main/day10
Felt easier than previous days and easier to express in Ruby.
=> More informations about this toot | View the thread
I just completed "Disk Fragmenter" - Day 9 - Advent of Code 2024 #AdventOfCode in #ruby
I abandoned a whole strategy (stuck at off-by-1s) and tried a completely different approach.
You can peek: https://gitlab.com/oinak/advent-of-code-2024/-/tree/main/day09
=> More informations about this toot | View the thread
I just completed "Resonant Collinearity" - Day 8 - Advent of Code 2024 #AdventOfCode with #ruby https://adventofcode.com/2024/day/8
Looked harder than it was but it was the first day I needed to sketch.
Have a peek if you want... https://gitlab.com/oinak/advent-of-code-2024/-/tree/main/day08
=> More informations about this toot | View the thread
I just completed "Bridge Repair" - Day 7 - Advent of Code 2024 #AdventOfCode https://adventofcode.com/2024/day/7 with #ruby, and today I got to use "case in" pattern matchin and recursion. So much easier than yesterday 😅
Have a look if you don't mind spoilers! https://gitlab.com/oinak/advent-of-code-2024/-/tree/main/day07
Leave me your comments if you did it differently
=> More informations about this toot | View the thread
I just completed "Guard Gallivant" - Day 6 - Advent of Code 2024 #AdventOfCode with #ruby https://adventofcode.com/2024/day/6
I almost gave up on part 2, because my bug (forgetting double turns) did not trigger with test input
=> More informations about this toot | View the thread
One year more...
[#]adventofcode #ruby
https://gitlab.com/oinak/advent-of-code-2024
let's play
=> More informations about this toot | View the thread
Some thoughts on memoization of methods in :ruby:
https://gitlab.com/-/snippets/3745145
=> More informations about this toot | View the thread
=> This profile with reblog | Go to oinak@ruby.social account This content has been proxied by September (3851b).Proxy Information
text/gemini