aoc2022/d02/part1b.awk

13 lines
353 B
Awk

#loose
$1=="A"&&$2=="Z"{S+=3;P+=6+1;next}
$1=="B"&&$2=="X"{S+=1;P+=6+2;next}
$1=="C"&&$2=="Y"{S+=2;P+=6+3;next}
#draw
$1=="A"&&$2=="X"{S+=3+1;P+=3+1;next}
$1=="B"&&$2=="Y"{S+=3+2;P+=3+2;next}
$1=="C"&&$2=="Z"{S+=3+3;P+=3+3;next}
#win
$1=="A"&&$2=="Y"{S+=6+2;P+=1;next}
$1=="B"&&$2=="Z"{S+=6+3;P+=2;next}
$1=="C"&&$2=="X"{S+=6+1;P+=3;next}
END{print S,P}