aoc2022/d02/part1b.awk

13 lines
290 B
Awk

#loose
$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}
#draw
$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}
#win
$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}
END{print S,P}