about summary refs log tree commit diff
path: root/day24.k
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-12-25 16:36:11 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-12-25 16:36:11 +0100
commitb7139aec67506ba6b7efa9f65ebe7d8ecbdfdd14 (patch)
treeed7022b112fce4e92a01111ed4c9b6bcdf9b6126 /day24.k
parentd2958c5af4d86a0b8586e1dc461d390fcc313c40 (diff)
downloadadventofcode2015-b7139aec67506ba6b7efa9f65ebe7d8ecbdfdd14.tar.gz
adventofcode2015-b7139aec67506ba6b7efa9f65ebe7d8ecbdfdd14.tar.xz
adventofcode2015-b7139aec67506ba6b7efa9f65ebe7d8ecbdfdd14.zip
day24
Diffstat (limited to 'day24.k')
-rw-r--r--day24.k15
1 files changed, 15 insertions, 0 deletions
diff --git a/day24.k b/day24.k
new file mode 100644
index 0000000..3bc50bc
--- /dev/null
+++ b/day24.k
@@ -0,0 +1,15 @@
+d:0$'0:"day24";
+
+/ n:3;
+n:4;
+
+/ stupid eager brute forcing
+r:{b::n#0; p:: (n;0)#(); { p[*<b],:x; b[*<b]+:x }'x; :[b~n#(+/d)%n; p; ()]};
+
+s:{x::();
+ while[x~();x::r[d@(-#d)?#d]];
+ m::m& */x@*<#:'x;
+ `0:($m),"\n";};
+
+m:0I;
+while[1;s[]];