2022 · Day 2

Rock Paper Scissors

★★ Solved 2022-12-09 Puzzle on adventofcode.com

Answers

Part one
13268
Part two
15508

Part one — working out

rounds
2500
won
672
lost
746
drawn
1082

Part two — working out

rounds
2500
won
1328
lost
338
drawn
834

Modelled the shapes as a PHP enum with beats() and losesTo(), which made part two fall out almost for free --- once you have the outcome you want, you ask the opponent's shape what loses to it.


Worth noting: X/Y/Z mean completely different things between the two parts, which is why there is no shared parse step.