diff options
Diffstat (limited to '2021/02/puzzle-1.awk')
-rwxr-xr-x | 2021/02/puzzle-1.awk | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/2021/02/puzzle-1.awk b/2021/02/puzzle-1.awk new file mode 100755 index 0000000..1caefc6 --- /dev/null +++ b/2021/02/puzzle-1.awk @@ -0,0 +1,6 @@ +#!/usr/bin/env -S awk -f + +/forward/ { hor += $2 } +/up/ { ver -= $2 } +/down/ { ver += $2 } +END { print hor * ver } |