Here's an enhanced tester with minimal parens:
 
   U =: (('(' , ,&')')^:(1 < #)@[ , 'U' , ])&.>

   >(U/@, , ])/ <"0'dcba'
dU(cU(bUa)Ua)U(bUa)Ua
cU(bUa)Ua            
bUa                  
a                    


----- Original Message ----
From: R.E. Boss <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Thursday, June 15, 2006 3:40:15 PM
Subject: RE: [Jprogramming] Programming puzzle


((U/@,),])/<"0'dcba'
+-----------------------------+-------------+-----+-+
|(dU((cU((bUa)Ua))U((bUa)Ua)))|(cU((bUa)Ua))|(bUa)|a|
+-----------------------------+-------------+-----+-+

compared to Rich's

d' = d U (c U (b U a) U a) U (b U a) U a   = d U c'

R.E. Boss


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Oleg Kobchenko
Verzonden: donderdag 15 juni 2006 20:52
Aan: Programming forum
Onderwerp: Re: [Jprogramming] Programming puzzle

No, it not correct what I sent. Here is tester:

   U=: ('(' , [ , 'U' , ] , ')'"_)&.>
   A=: 1 : 'u~/\&.|.'

   U A <"0'dcba'
+-------------+---------+-----+-+
|(((dUc)Ub)Ua)|((cUb)Ua)|(bUa)|a|
+-------------+---------+-----+-+

So you can test different combinations

   U/\.&.|. <"0'dcba'
+-+-----+---------+-------------+
|d|(cUd)|(bU(cUd))|(aU(bU(cUd)))|
+-+-----+---------+-------------+
   U/\. <"0'dcba'
+-------------+---------+-----+-+
|(dU(cU(bUa)))|(cU(bUa))|(bUa)|a|
+-------------+---------+-----+-+


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to