aboutsummaryrefslogtreecommitdiff
path: root/2015/10/puzzles.sh
diff options
context:
space:
mode:
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