advent-of-code/2022/day02/main2.sh

10 lines
261 B
Bash
Raw Permalink Normal View History

2022-12-17 01:16:18 +01:00
#!/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/'