It's that time of the year again! Random solutions to the Advent of Code challenge (https://adventofcode.com). This year, it's in ... (rolls dice) ... RUBY!
This year, I'm also trying something new: I'll make a commit whenever I try to submit a new answer. If the answer is correct, then it's going to be the last commit, if not, the progress can be inspected as I (hopefully) figure out what's wrong with it.
You'll need Ruby >= 3.1
. The easiest way to setup the environment is to use asdf
, the .tool-versions
file will select the preferred version automatically.
After cloning the repository, enter into the solutions directory and type ruby dayXX.rb
to print the answer for the questions. If you want to run the code on a different input, replace the relevant files in the inputs
directory.
The input paths are relative and hardcoded into the source.
Here is a collection of solutions in many languages: https://github.com/Bogdanp/awesome-advent-of-code