&2@(*&3@*:)   add 2 after multiplying by 3 after squaring.

Atop and at let me construct expressions by "successive approximation".
I love them.

   f y         NB. gives me a result,
   g@:f y      NB. results in a noun closer to what I need

Roughly quoting Mick Jagger, "Tack on verbs to the left until you get
what you need."

> Date: Mon, 11 Feb 2013 04:45:47 -0500
> From: "Linda Alvord" <[email protected]>
> To: <[email protected]>
> Subject: [Jprogramming] Basic Mystery
> Message-ID: <000001ce083c$921f2e20$b65d8a60$@net>
> Content-Type: text/plain;     charset="us-ascii"
> 
> Morning Wakeup Exercise:
> 
>  
> 
>     g=: +&2@(*&3@*:)
> 
>    ]y=: g 5
> 
> 77


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

Reply via email to