summaryrefslogtreecommitdiff
path: root/2022/day02/main2.sh
diff options
context:
space:
mode:
Diffstat (limited to '2022/day02/main2.sh')
-rwxr-xr-x2022/day02/main2.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/2022/day02/main2.sh b/2022/day02/main2.sh
new file mode 100755
index 0000000..2acfd50
--- /dev/null
+++ b/2022/day02/main2.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# gleichstand 3
+# gewonnen 6
+# A X=Rock 1
+# B Y=Paper 2
+# C Z=Scissors 3
+cat /dev/stdin | sed -e 's/A X/0+3/' -e 's/B X/0+1/' -e 's/C X/0+2/' \
+ -e 's/A Y/3+1/' -e 's/B Y/3+2/' -e 's/C Y/3+3/' \
+ -e 's/A Z/6+2/' -e 's/B Z/6+3/' -e 's/C Z/6+1/'