Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!spool.mu.edu!howland.reston.ans.net!wupost!gumby!ursa!ursa!abalje47
From: abalje47@ursa.calvin.edu (Alan Baljeu)
Subject: help with a j "split" function
Message-ID: <abalje47.730255144@ursa>
Keywords: J
Sender: news@calvin.edu
Organization: Calvin College
Date: Sun, 21 Feb 1993 00:39:04 GMT
Lines: 29

I'm trying to construct a function that will work like this:

	0 1 2 1 0 0 1 split 1 2 3 4 5 6 7
+-------+-------+---+
| 1 5 6 | 2 4 7 | 3 |
+-------+-------+---+
	1 1 0 1 0 split 2 5 6 1 2
+-----+-------+
| 6 2 | 2 5 1 |
+-----+-------+
I'll be satisfied if only the second example is accomplished.

It seems to me it should not be too difficult to do, but the natural
	split  =. ';/ (rotate x. =/ i. shape x.) copy y.' : 11
produces extra zeros that I don't want, and don't see an easy way to remove.
Besides that, for a long list, it creates a rather large array in the process.

By the way, I'll probably use the function like:
	fivesplit =. (5: > right) split right
	fivesplit 2 4 7 3 76 
+-------+------+
| 2 4 3 | 7 76 |
+-------+------+

Thanks.
Alan Baljeu
--
			Alan Baljeu
This signature is.
