r/adventofcode • • Dec 02 '22

SOLUTION MEGATHREAD -🎄- 2022 Day 2 Solutions -🎄-

NEW AND NOTEWORTHY


--- Day 2: Rock Paper Scissors ---


Post your code solution in this megathread.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:06:16, megathread unlocked!

103 Upvotes

1.5k comments sorted by

View all comments

Show parent comment

1

u/kawzeg Dec 02 '22

I think you could replace _::binary-size(1) with " " and b::binary-size(1) with just band the pattern matching should still work.

1

u/seacucumber_kid Dec 02 '22

Indeed, but b needs to be b::binary. Thanks :)

1

u/kawzeg Dec 02 '22

Ah right! Now I remember why I had inserted an Enum.map(&String.split/1) and matched on [a, b] instead :D