aboutsummaryrefslogtreecommitdiff
path: root/2019/07/puzzle-1.sh
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-12-18 14:20:57 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-12-18 14:20:57 +0100
commit65beb3ea0223e693ac348c6133e496ada2b2352f (patch)
tree94618b1e50c2a0bf5a1506860b1d86ce42de72f9 /2019/07/puzzle-1.sh
parent5b14deaca70a8bda4093a2897d304b80c860acf0 (diff)
Add 2019 day 7 solutions
Diffstat (limited to '2019/07/puzzle-1.sh')
-rwxr-xr-x2019/07/puzzle-1.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/2019/07/puzzle-1.sh b/2019/07/puzzle-1.sh
new file mode 100755
index 0000000..38fd725
--- /dev/null
+++ b/2019/07/puzzle-1.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+python -c '
+import itertools
+for p in itertools.permutations([0, 1, 2, 3, 4]):
+ print(*p)
+' | while read a b c d e
+do
+ ./machine.lisp $a 0 \
+ | ./machine.lisp $b \
+ | ./machine.lisp $c \
+ | ./machine.lisp $d \
+ | ./machine.lisp $e
+done | sort -nr | head -n1 \ No newline at end of file