Here are my golfed solutions to Advent of Code 2022.
All programs read data from the standard input stream and outputs answers to the standard output stream. This makes very easy to run programs with different set of input tests.
You can pass file with stdin using < in the shell.
Or pass filename as parameter or pass content with |
pipe.
ruby solver.rb < test0.in
ruby solver.rb test0.in
or
echo "A X\nB Z" | ruby solver.rb
⛳ 12/50