aoc2022/d02/part1b.awk

13 lines
290 B
Awk
Raw Normal View History

2022-12-02 09:26:15 +00:00
#loose
2022-12-02 22:32:38 +00:00
$0=="A Z"{S+=3;P+=6+1;next}
$0=="B X"{S+=1;P+=6+2;next}
$0=="C Y"{S+=2;P+=6+3;next}
2022-12-02 09:26:15 +00:00
#draw
2022-12-02 22:32:38 +00:00
$0=="A X"{S+=3+1;P+=3+1;next}
$0=="B Y"{S+=3+2;P+=3+2;next}
$0=="C Z"{S+=3+3;P+=3+3;next}
2022-12-02 09:26:15 +00:00
#win
2022-12-02 22:32:38 +00:00
$0=="A Y"{S+=6+2;P+=1;next}
$0=="B Z"{S+=6+3;P+=2;next}
$0=="C X"{S+=6+1;P+=3;next}
2022-12-02 09:26:15 +00:00
END{print S,P}