Probably not very fast, but this one is cool: 3 /:@:(([,-.~) i.) 10 1 2 3 0 4 5 6 7 8 9
Marshall -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of R.E. Boss Sent: Saturday, April 30, 2011 4:48 PM To: 'Programming forum' Subject: Re: [Jprogramming] A permutation of i.y This revealed an error in my solution. It should be 3 7 (+/@:!@(]->:@([+ i.@-~)/@[) A. i.@] )10 0 1 2 4 5 6 7 3 8 9 0 3 (+/@:!@(]->:@([+ i.@-~)/@[) A. i.@] )10 1 2 3 0 4 5 6 7 8 9 If only the first item has to be moved, then you get the simpler 3 (+/@:!@(]->:@i.@[) A. i.@] )10 1 2 3 0 4 5 6 7 8 9 R.E. Boss > -----Oorspronkelijk bericht----- > Van: [email protected] [mailto:programming- > [email protected]] Namens Brian Schott > Verzonden: zaterdag 30 april 2011 17:40 > Aan: Programming forum > Onderwerp: Re: [Jprogramming] A permutation of i.y > > Yet another approach? > > foo0=: +/@:!@:>:@:i. > foo =: (<:@]-&foo0-~) A. i.@] > 3 foo 9 > 1 2 0 3 4 5 6 7 8 > > > On Fri, Apr 29, 2011 at 10:05 AM, Raul Miller <[email protected]> wrote: > > This might be what you want: > > > > foo=: (C.~ <)&i.~ > > > > 3 (C.~ <)&i.~ 9 > > 1 2 0 3 4 5 6 7 8 > > > > -- > > Raul > > > -- > (B=) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
