I once asked something like this. Roger Hui made me aware of the essay, in this case http://www.jsoftware.com/jwiki/Essays/Odometer
On Mon, 2011-09-05 at 22:28 +0800, [email protected] wrote: > Date: Mon, 5 Sep 2011 14:53:51 +0100 > From: Steven Taylor <[email protected]> > Subject: [Jprogramming] all indicies of a shape > To: Programming forum <[email protected]> > Message-ID: > <CA+zYriQmk=ku0ghiywf=9jPH1J6YRR > [email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > I got curious about producing all elements of an array of the shape S. > > This is what I came up with: > > [S=.2 4 2 > [prd=.1,}:*/\ S > [c=.(*/S) > S|"(0 1) prd ([:<.%~)"(0 1) i. c ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
