diff options
Diffstat (limited to '2015/02/puzzle-1.awk')
-rwxr-xr-x | 2015/02/puzzle-1.awk | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/2015/02/puzzle-1.awk b/2015/02/puzzle-1.awk deleted file mode 100755 index 5c05d31..0000000 --- a/2015/02/puzzle-1.awk +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/awk -f - -function min(a, b, c) { - if (a <= b && a <= c) - return a - if (b <= a && b <= c) - return b - return c -} - -BEGIN { FS = "x" } -{ - # START PART 1 - x = $1 * $2 - y = $2 * $3 - z = $1 * $3 - - sum += (2 * x) + (2 * y) + (2 * z) + min(x, y, z) -} -END { print sum } |