Well after some persistence I came up with
   3 3 $ (1 1; 1 0; 1 _1; 0 1; 0 0; 0 _1; _1 1; _1 0; _1 _1) |. each
(R;R;R;R;R;R;R;R;R)
┌─────────────┬─────────────┬─────────────┐
│0 0 1 1 0 0 0│0 0 0 1 1 0 0│0 0 0 0 1 1 0│
│0 1 1 0 0 0 0│0 0 1 1 0 0 0│0 0 0 1 1 0 0│
│0 0 1 0 0 0 0│0 0 0 1 0 0 0│0 0 0 0 1 0 0│
│0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
│0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
├─────────────┼─────────────┼─────────────┤
│0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
│0 0 1 1 0 0 0│0 0 0 1 1 0 0│0 0 0 0 1 1 0│
│0 1 1 0 0 0 0│0 0 1 1 0 0 0│0 0 0 1 1 0 0│
│0 0 1 0 0 0 0│0 0 0 1 0 0 0│0 0 0 0 1 0 0│
│0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
├─────────────┼─────────────┼─────────────┤
│0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
│0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
│0 0 1 1 0 0 0│0 0 0 1 1 0 0│0 0 0 0 1 1 0│
│0 1 1 0 0 0 0│0 0 1 1 0 0 0│0 0 0 1 1 0 0│
│0 0 1 0 0 0 0│0 0 0 1 0 0 0│0 0 0 0 1 0 0│
└─────────────┴─────────────┴─────────────┘



On Sat, Aug 15, 2009 at 5:41 PM, Ian Gorse<[email protected]> wrote:
> Hi everyone,
>
> I just been looking at a youtube video of Conways Games Of Life in APL
> ( http://www.youtube.com/watch?v=a9xAKttWgP4 )
>
> And decided to follow it as much as I could in J. I have included the
> time frame in NB. so you can fast foward the video yourself
>
>
> NB. 0:47
> R=. _1 _2 |. 5 7 {. r=. (3 3 $ i.9) e. 1 2 3 4 7
>
>   R
> 0 0 0 0 0 0 0
> 0 0 0 1 1 0 0
> 0 0 1 1 0 0 0
> 0 0 0 1 0 0 0
> 0 0 0 0 0 0 0
>
> NB. 1:00
>   R;R;R
> ┌─────────────┬─────────────┬─────────────┐
> │0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
> │0 0 0 1 1 0 0│0 0 0 1 1 0 0│0 0 0 1 1 0 0│
> │0 0 1 1 0 0 0│0 0 1 1 0 0 0│0 0 1 1 0 0 0│
> │0 0 0 1 0 0 0│0 0 0 1 0 0 0│0 0 0 1 0 0 0│
> │0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
> └─────────────┴─────────────┴─────────────┘
>
>
> NB. 1:14... surely there is a better way to do this??
>   |: each 1 0 _1 |. each |: each R;R;R
> ┌─────────────┬─────────────┬─────────────┐
> │0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
> │0 0 1 1 0 0 0│0 0 0 1 1 0 0│0 0 0 0 1 1 0│
> │0 1 1 0 0 0 0│0 0 1 1 0 0 0│0 0 0 1 1 0 0│
> │0 0 1 0 0 0 0│0 0 0 1 0 0 0│0 0 0 0 1 0 0│
> │0 0 0 0 0 0 0│0 0 0 0 0 0 0│0 0 0 0 0 0 0│
> └─────────────┴─────────────┴─────────────┘
>
> Now this is where I am stuck.
> At 1:56 in the video, he creates 9 copies of R (3 3 $
> R;R;R;R;R;R;R;R;R), and rotates each one using "outer product column
> rotation"
> (sorry I don't know how to explain it any better, so you will need to
> check the video yourself)
>
> Can someone please explain how this can be achieved in J?
>
> Thanks
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to