aboutsummaryrefslogtreecommitdiff
path: root/2015/10/puzzles.sh
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2021-10-29 23:02:39 +0200
committerThomas Voss <thomasvoss@live.com> 2021-10-29 23:02:39 +0200
commite7c9108b95e39d7ea5a29ae06d619c4727f11027 (patch)
tree237261eef3afd0720be77dbcbb9599fa66a24b67 /2015/10/puzzles.sh
Initial commit
Diffstat (limited to '2015/10/puzzles.sh')
-rwxr-xr-x2015/10/puzzles.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/2015/10/puzzles.sh b/2015/10/puzzles.sh
new file mode 100755
index 0000000..291ac96
--- /dev/null
+++ b/2015/10/puzzles.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env sh
+
+output()
+{
+ echo $in | tr -d '\n' | wc -c
+}
+
+in=$(cat input)
+for i in $(seq 1 50); do
+ in=$(echo "$in" | fold -w1 | uniq -c | tr -d '\n ')
+ [ $i -eq 40 ] && output
+done
+output