On Mon, Mar 25, 2013 at 5:22 PM, Jeremy Smith
<[email protected]> wrote:
> life =: +./@((1 ,: [) (*."2) 3 4 e."0/ +/@(+/@(1 0 _1 |."0 2/ 1 0 _1 |."0 1/
> [)))
>
> And then (i.4) gen board indeed gives me what I want. But I cannot figure
> out how to define "gen" so that the syntax "4 gen board"
sbd =: ?10 10$2
life =: +./@((1 ,: [) (*."2) 3 4 e."0/ +/@(+/@(1 0 _1 |."0 2/ 1 0 _1 |."0 1/
[)))
lifer =: 0&(life@])
lifert =: <@[ 0&(life@]) ]
<"2'.#'{~ 5 lifert 10 lifer sbd
+----------+----------+----------+----------+----------+
|...######.|...#....#.|...#..#.##|#..#.##.##|##.##...##|
|.#.#.....#|.#.#.#####|#.#.#.##.#|.###......|##.#...#.#|
|##.#......|.........#|.#....##.#|...#.##...|...##.....|
|##........|.##......#|.##.....##|..........|..#...#...|
|.........#|.#......#.|.##.....##|.##....#..|........#.|
|#.......##|#......#..|.......#.#|.......#.#|..........|
|.......##.|.......##.|......#..#|......###.|......#..#|
|..........|.......##.|......#...|......#.#.|......#.#.|
|.......#..|.......#..|.......##.|.......#..|.......##.|
|..#..###..|...#......|..........|.........#|#.....##.#|
+----------+----------+----------+----------+----------+
Ambrus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm