Cut and paste requires that you remember to paste! d=:7#"1 ,.2#4 6 8 12 20 NB. Create array d r=: 13 :'1+?y' r r d r d 4!:0 ;:'d r' toss=: 13 :'+/1+?y' toss toss d c=:toss d c
NB.fdkm =: [: /:~ ~. ,. [: +/"1 ~. =/ ] NB.fdkm c NB.fdla=: 13 :'/:~(~.y),.+/"1 (~.y)=/y' NB.fdla c NB.fdkm NB.fdla fdrs=: 13 :'/:~y({., #)/.y' fdrs [: /:~ ({. , #)/.~ fd=: 13 :'/:~y({., #)/.y' fd [: /:~ ({. , #)/.~ fd toss d fd c=:toss d c fd c=:toss d c purr=:13 :'(0{"1 y) ,.100*(1{"1 y)%+/1{"1 y' purr purr c purr fd toss d cc=:4 2$7 1 9 2 10 1 11 3 cc purr cc assert 100=+/1{"1 purr cc d=:500000#"1 ,.2#4 6 8 12 20 fd toss d ]cc=:fd toss d purr cc assert 100=+/1{"1 purr fd toss d assert 100=+/1{"1 purr cc 4!:0 ;:'c cc d r toss fd purr' Linda -----Original Message----- From: programming-boun...@jsoftware.com [mailto:programming-boun...@jsoftware.com] On Behalf Of Björn Helgason Sent: Sunday, December 11, 2011 11:28 AM To: Programming forum Subject: Re: [Jprogramming] FW: Turkey Roll - Challenge 2 f9seq=: 3 : ';@:{&(1;0 1)^:y 0' f9a =: +/ @ f9seq f9a"0 [>:i.5 1 1 2 3 5 [d=:4*2#7#"1,.1 1.5 2 3 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 6 6 6 6 6 6 6 6 6 6 6 6 6 6 8 8 8 8 8 8 8 8 8 8 8 8 8 8 12 12 12 12 12 12 12 12 12 12 12 12 12 12 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2011/12/11 Linda Alvord <lindaalv...@verizon.net> > > > -----Original Message----- > From: Linda Alvord [mailto:lindaalv...@verizon.net] > Sent: Sunday, December 11, 2011 10:27 AM > d=:7#"1 ,.2#4 6 8 12 20 NB. Create array > d > 4 4 4 4 4 4 4 > 4 4 4 4 4 4 4 > 6 6 6 6 6 6 6 > 6 6 6 6 6 6 6 > 8 8 8 8 8 8 8 > 8 8 8 8 8 8 8 > 12 12 12 12 12 12 12 > 12 12 12 12 12 12 12 > 20 20 20 20 20 20 20 > 20 20 20 20 20 20 20 > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm