RosettaCodeData/Task/Multisplit/J/multisplit-1.j

13 lines
307 B
Text
Raw Permalink Normal View History

2014-01-17 05:32:22 +00:00
multisplit=: 4 :0
'sep begin'=. |: t=. y /:~&.:(|."1)@;@(i.@#@[ ,.L:0"0 I.@E.L:0) x
2013-04-10 21:29:02 -07:00
end=. begin + sep { #@>y
2014-01-17 05:32:22 +00:00
last=. next=. 0
r=. 2 0$0
while. next<#begin do.
r=. r,.(last}.x{.~next{begin);next{t
last=. next{end
next=. 1 i.~(begin>next{begin)*.begin>:last
2013-04-10 21:29:02 -07:00
end.
2014-01-17 05:32:22 +00:00
r=. r,.'';~last}.x
2013-04-10 21:29:02 -07:00
)