about summary refs log tree commit diff
path: root/day13.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'day13.ijs')
-rw-r--r--day13.ijs9
1 files changed, 9 insertions, 0 deletions
diff --git a/day13.ijs b/day13.ijs
new file mode 100644
index 0000000..9accec0
--- /dev/null
+++ b/day13.ijs
@@ -0,0 +1,9 @@
+load 'aoc.ijs'
+'t oy' =: lines 'day13'
+x =: 0
+y =: 0 -.~ oy =: x: ".&> (<;._1 ',',oy)
+
+(n{y)*v{~n=.{./:v=.y-y|".t  NB. 2298
+
+minv =: ]|(^-&2x)  NB. x assumed prime
+(*/y)|+/(-oy i. y)*((*/%])([*minv)])y  NB. 783685719679632