From ab1a834e1dded68d7d722148000cce2503b56d57 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 1 Dec 2022 13:37:51 +0100 Subject: Slight refactor --- 2022/01/puzzle-2.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '2022/01/puzzle-2.awk') diff --git a/2022/01/puzzle-2.awk b/2022/01/puzzle-2.awk index d8bbaaa..6186084 100755 --- a/2022/01/puzzle-2.awk +++ b/2022/01/puzzle-2.awk @@ -1,7 +1,7 @@ #!/usr/bin/awk -f -/[0-9]+/ { acc += $1; next } -{ +/[0-9]+/ { acc += $1 } +!/./ { if (acc > max[1]) { max[3] = max[2]; max[2] = max[1]; -- cgit v1.2.3