diff options
| author | Alex Pickering <alex@cogarr.net> | 2025-02-07 12:49:48 -0600 |
|---|---|---|
| committer | Alex Pickering <alex@cogarr.net> | 2025-02-07 12:49:48 -0600 |
| commit | 3555be54c2abb8d5ece008a60dbdfbde0ffbddd7 (patch) | |
| tree | 278876284d07118ecdea5c48cb6453f3122887f0 /02/2.lua | |
| download | advent_of_code_2022-master.tar.gz advent_of_code_2022-master.tar.bz2 advent_of_code_2022-master.zip | |
Diffstat (limited to '02/2.lua')
| -rw-r--r-- | 02/2.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/02/2.lua b/02/2.lua new file mode 100644 index 0000000..40ed0d3 --- /dev/null +++ b/02/2.lua @@ -0,0 +1,21 @@ +require("ext") + +local points = { + ["A X"] = 3 + 0, + ["A Y"] = 1 + 3, + ["A Z"] = 2 + 6, + + ["B X"] = 1 + 0, + ["B Y"] = 2 + 3, + ["B Z"] = 3 + 6, + + ["C X"] = 2 + 0, + ["C Y"] = 3 + 3, + ["C Z"] = 1 + 6, +} + +local score = 0 +for line in io.lines() do + score = score + points[line] +end +print(score) |
