Initial commit

This commit is contained in:
Dimitri Lozeve 2024-11-12 21:43:32 +01:00
commit f242d2b0df
420 changed files with 62521 additions and 0 deletions

6
2021/day02/day02.awk Normal file
View file

@ -0,0 +1,6 @@
/down/ {aim += $2}
/up/ {aim -= $2}
/forward/ {pos += $2; depth += aim * $2}
END {print pos * aim, pos * depth}
# one-liner
# /^d/{a+=$2}/u/{a-=$2}/f/{p+=$2;d+=a*$2}END{print p*a,p*d}