Skip to content

Instantly share code, notes, and snippets.

@randomra
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randomra/066a2f33414f5d6c04b1 to your computer and use it in GitHub Desktop.
Save randomra/066a2f33414f5d6c04b1 to your computer and use it in GitHub Desktop.
f=.4 :0
m=.>:>./x,y
t=.(|+(1+m)*0>:*)@(i.@#-~])@(],m$~(>&#)*(-&#))
x(t~(*@-&((m+#x,y)&#.))t)y
)
(0) f (>a:)
1
(>a:) f (1)
1
(>a:) f (1,2,1,2)
1
(2,1) f (1,1)
1
(0,1,2) f (0,2,1)
1
(3,0) f (3,1)
1
(3,1) f (3)
1
(2) f (2,2)
1
(2) f (2,23)
1
(2,24) f (2,23)
1
(2,1) f (2,23)
1
(>a:) f (>a:)
0
(0) f (0)
0
(1,1) f (1,1)
0
(2,1,2) f (2,1,2)
0
(1,2,1,1,2) f (1,2,1,1,1)
_1
(1,2,1,1,5) f (1,2,1,1,4)
_1
(1,2,1,1,5) f (1,2,1,1)
_1
(1,2,1) f (1,2,1,1)
_1
(1,2,1,1,5) f (1,2,1,1,6)
_1
(1,2,1,1,6) f (1,2,1,1,7)
_1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment