summaryrefslogtreecommitdiff
path: root/problem81.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem81.ijs')
-rw-r--r--problem81.ijs11
1 files changed, 11 insertions, 0 deletions
diff --git a/problem81.ijs b/problem81.ijs
new file mode 100644
index 0000000..7d89276
--- /dev/null
+++ b/problem81.ijs
@@ -0,0 +1,11 @@
+solve =: {{
+ data =. ;: fread y
+ mat =. (2#%:-:#data)$".>{.|:(2,~-:#data)$data
+ diags =. </.mat
+ k =. <.-:#diags
+ 'a b' =. (k{.diags);<k}.diags
+ step =. {{<<./>x+each {{(_,y);y,_}}>y}}
+ <./>(step/b) step step/|.a
+}}
+
+problem81 =: solve 'p081_matrix.txt'