aboutsummaryrefslogtreecommitdiff
path: root/2022/02/puzzle-1.awk
diff options
context:
space:
mode:
Diffstat (limited to '2022/02/puzzle-1.awk')
-rwxr-xr-x2022/02/puzzle-1.awk10
1 files changed, 10 insertions, 0 deletions
diff --git a/2022/02/puzzle-1.awk b/2022/02/puzzle-1.awk
new file mode 100755
index 0000000..e1df191
--- /dev/null
+++ b/2022/02/puzzle-1.awk
@@ -0,0 +1,10 @@
+#!/usr/bin/awk -f
+
+/X/ { s += 1 }
+/Y/ { s += 2 }
+/Z/ { s += 3 }
+
+/A X|B Y|C Z/ { s += 3 }
+/A Y|B Z|C X/ { s += 6 }
+
+END { print s }