doubles=:2&*~ i.
5 doubles 3
5 10 20
Lippu Esa wrote:
> Hi!
>
> I have been using tacit programming for some time. It is not unusual
> that
> difficulties arise due to my shallow understanding of the J language.
>
> The current problem can be demonstrated with a simple example:
>
> I want a doubling function that takes two parameters. The first one is
> the number to be doubled and the
> other one tells how many times. Like:
>
> +:^: (<3) 5
> 5 10 20
>
> How can I do it tacitly, i.e.: 5 multidbl 3 should give the same result?
>
> The problem appeared when I finally began to program my own life :)
> inspired by this demonstration and FinnAPL Tallinn conference in Estonia
> starting on Wednesday (and yes, there are three J-related presentations,
> all by our Estonian friends).
>
> www.youtube.com/watch?v=a9xAKttWgP4
>
> I actually got this generation function working somehow but it annoyed
> me that I couldn't give the nouns in the same order as in the
> presentation, life matrix on the left side and generation count on the
> other. This one was ok:
>
> gen=.life^:[]
> 3 gen R
>
> I tried to understand the problem by writing a much simpler function but
> didn't get it working tacitly at all. I also tried to find some
> information from the documentation but didn't recognize any. It would be
> nice to get my own life working before looking for better life :) .
>
> Best Regards,
> Esa
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Clifford A. Reiter
Mathematics Department, Lafayette College
Easton, PA 18042 USA, 610-330-5277
http://www.lafayette.edu/~reiterc
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm