aboutsummaryrefslogtreecommitdiff
path: root/2021/01/puzzles.sh
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2021-12-01 08:56:00 +0100
committerThomas Voss <thomasvoss@live.com> 2021-12-01 08:56:00 +0100
commit394df58d6da6928a6a3ebae31362342deca74b48 (patch)
tree9d9130761da691dbe923b5f1400bec69e087c223 /2021/01/puzzles.sh
parent32fe21038a75a3f6da911c92247e422885cb521b (diff)
Add a shell script solution
Diffstat (limited to '2021/01/puzzles.sh')
-rw-r--r--2021/01/puzzles.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/2021/01/puzzles.sh b/2021/01/puzzles.sh
new file mode 100644
index 0000000..9cf8043
--- /dev/null
+++ b/2021/01/puzzles.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+paste -s input | awk '{ for (i = 1; i < NF; i++) c += $i < $(i + DELTA) } END { print c }'