The tree looks ok, but does the algorithm meet your specs? I understood them to include, randomly choose an argument letter to be the top of the tree, randomly add to it a second letter and scramble to form the second row of the tree, randomly add a third letter and scramble to form the third row, and so on. The present algorithm always chooses the first letter of the argument to be the top of the tree, always adds the second letter and scrambles to form the second row, always adds the third letter and scrambles to form the third row, and so on.
Kip Sent from my iPad On Feb 28, 2012, at 4:54 AM, "Linda Alvord" <lindaalv...@verizon.net> wrote: > Kip, I thought that too at first, but doesn't his final tree looks ok? > > Linda > > > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of km > Sent: Monday, February 27, 2012 11:47 PM > To: Programming forum > Subject: Re: [Jprogramming] Challenge 6 Many Many Cherry Trees > > A flaw in this one is that if you work from top to bottom, writing in order > the new letter in each row of the result, you have found the argument > string. A preliminary shuffle of the argument string is needed. > > Kip > > Sent from my iPad > > > On Feb 27, 2012, at 10:21 PM, "Linda Alvord" <lindaalv...@verizon.net> > wrote: > >> I found it surprising how many different strategies were used. This may be >> the simplest approach. >> >> Linda >> >> -----Original Message----- >> From: programming-boun...@jsoftware.com >> [mailto:programming-boun...@jsoftware.com] On Behalf Of Ric Sherlock >> Sent: Saturday, February 25, 2012 2:08 AM >> To: Programming forum >> Subject: Re: [Jprogramming] Challenge 6 Many Many Cherry Trees >> >> Coming to this late but here's my version anyway: >> >> shuffle=: {~ [: ?~ # >> spacing=: [: , ' '&,. >> pad=: |."_1~ i.&.-@# >> gw=: [: pad spacing@shuffle\ NB. what does gw stand for? >> >> gw 'cherrytree' >> c >> c h >> e c h >> c h r e >> c r h r e >> r e c y h r >> y t e h r r c >> r h r r y c e t >> r r h r c e e t y >> h e c r e r t y r e >> ---------------------------------------------------------------------- >> 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 > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm