taoc2: fix comments - aoc22 - advent of code 2022 solutions | |
git clone git://src.adamsgaard.dk/aoc22 | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 75a74ad3eda514d3351f5d200124c304d1354d39 | |
parent 0ab0cad54d0cabd8add1b8cb79604b06b5e042c6 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 2 Dec 2022 15:44:08 +0000 | |
aoc2: fix comments | |
Diffstat: | |
M 2/aoc2 | 6 +++--- | |
1 file changed, 3 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/2/aoc2 b/2/aoc2 | |
t@@ -3,7 +3,7 @@ | |
BEGIN { | |
value["A"] = 1 # rock | |
value["B"] = 2 # paper | |
- value["C"] = 3 # scissor | |
+ value["C"] = 3 # scissors | |
} | |
{ | |
t@@ -11,9 +11,9 @@ BEGIN { | |
sub(/Y/, "B") | |
sub(/Z/, "C") | |
sum += value[$2] | |
- if ($1 == $2) # draw | |
+ if ($1 == $2) | |
sum += 3 | |
- else { # won or lost | |
+ else { | |
if (($1 == "A" && $2 == "B") || | |
($1 == "B" && $2 == "C") || | |
($1 == "C" && $2 == "A")) |