This commit is contained in:
setop 2021-12-02 09:03:37 +01:00
parent e9578d9baa
commit ec615662a4
3 changed files with 1012 additions and 0 deletions

5
d02/d02_1.awk Normal file
View File

@ -0,0 +1,5 @@
BEGIN { h = 0; d = 0; a = 0; }
$1 == "forward" { h+=+$2; d+=+$2*a; }
$1 == "up" { a-=+$2 }
$1 == "down" { a+=+$2 }
END { print h*d }

1001
d02/input Normal file

File diff suppressed because it is too large Load Diff

6
d02/sample Normal file
View File

@ -0,0 +1,6 @@
forward 5
down 5
forward 8
up 3
down 8
forward 2