View on GitHub

advent-of-code-2022

Readable Advent of Code 2022 algorithms and solutions in C language

Day 2: Rock, Paper, Scissors

Part A

Let $S=\lbrace 1,2,3\rbrace$. Let $\ell$ be a list where for all $(s_0,s_1)\in\ell$ we have $(s_0,s_1)\in S\times S$.

Let $a\leftarrow 0$.

For $(s_0,s_1)\in\ell$:

Return $a$.

Part B

Let $S=\lbrace 1,2,3\rbrace$. Let $T=\lbrace 0,3,6\rbrace$. Let $\ell$ be a list where for all $(s,t)\in\ell$ we have $(s,t)\in S\times T$.

Let $a\leftarrow 0$.

For $(s,t)\in\ell$:

Return $a$.