diff options
author | Thomas Voss <mail@thomasvoss.com> | 2022-11-30 12:23:17 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2022-11-30 12:23:17 +0100 |
commit | f3e3e3e354b87f4ce27bd74bf14cec05d06974b6 (patch) | |
tree | 112352e9c3ba5d5d924036def2b5f853d3f8dc28 /2015/02/puzzle-2.awk | |
parent | 4742dd73046c53cff7fe54deee58358c3b193206 (diff) |
Lots of cleanup and stuff
Diffstat (limited to '2015/02/puzzle-2.awk')
-rwxr-xr-x | 2015/02/puzzle-2.awk | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/2015/02/puzzle-2.awk b/2015/02/puzzle-2.awk index e031b94..450aed9 100755 --- a/2015/02/puzzle-2.awk +++ b/2015/02/puzzle-2.awk @@ -1,7 +1,6 @@ -#!/usr/bin/env -S awk -f +#!/usr/bin/awk -f -function min(a, b, c) -{ +function min(a, b, c) { if (a <= b && a <= c) return a if (b <= a && b <= c) @@ -16,5 +15,6 @@ BEGIN { FS = "x" } z = $1 + $1 + $3 + $3 sum += $1 * $2 * $3 + min(x, y, z) + # END PART 2 } END { print sum } |