((U/@,),])/ does the job: ((+/@,),])/ _8 _3 1 4 7 6 5 4 R.E. Boss
-----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Henry Rich Verzonden: donderdag 15 juni 2006 20:26 Aan: 'Programming forum' Onderwerp: RE: [Jprogramming] Programming puzzle I need c U b', not c U b, etc. Here's test data: Let the list be _8 _3 1 4 and let U be + . Then: 4 4 1 + 4 5 _3 + (1 + 4) + 4 6 _8 + (_3 + (1 + 4) + 4) + (1 + 4) + 4 7 The result should be 7 6 5 4 . Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Brian Schott > Sent: Thursday, June 15, 2006 2:20 PM > To: Programming forum > Subject: Re: [Jprogramming] Programming puzzle > > Henry, > > I am not sure I understand but ... > > Your pattern > dUc cUb bUa aUx where x is an identity element or a zero > element, I am not sure of the terminology, looks like a > simple pattern handled by infix concept 2 U/\ ] applied to > the reverse of the list and then the result reversed. > > But surely this is to simple. > > (B=) > > On Thu, 15 Jun 2006, Henry Rich wrote: > > + I have a list that ends ... d c b a . > + > + I want to create a new list that ends > + > + ... > + d' = d U (c U (b U a) U a) U (b U a) U a = d U c' > + c' = c U (b U a) U a = c U b' > + b' = (b U a) = b U a' > + a' = a > + > + where U is some verb. > + > + It seems that there should be some form of / \. etc. that > + produces this, but I can't find it. Help! > + > + Henry Rich > + > + > ---------------------------------------------------------------------- > + For information about J forums see > http://www.jsoftware.com/forums.htm > + > > (B=) <----------my "sig" > > Brian Schott > Atlanta, GA, USA > schott DOT bee are eye eh en AT gee em ae eye el DOT com > http://schott.selfip.net/~brian/ > ---------------------------------------------------------------------- > 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
