Is it just me?Rules
The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:
Any live cell with fewer than two live neighbours dies, as if by underpopulation.
Any live cell with two or three live neighbours lives on to the next generation.
Any live cell with more than three live neighbours dies, as if by overpopulation.
Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
These rules, which compare the behavior of the automaton to real life, can be condensed into the following:
Any live cell with two or three live neighbours survives.
Any dead cell with three live neighbours becomes a live cell.
All other live cells die in the next generation. Similarly, all other dead cells stay dead.
The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed, live or dead; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick.[nb 1] Each generation is a pure function of the preceding one. The rules continue to be applied repeatedly to create further generations.
Conway's Life, Wikipedia, um.
- zip accident
- Sheepie Whore

- Posts: 13928
- Joined: Sun Feb 20, 2005 1:58 pm 0
- Location: Bristol, UK
Conway's Life, Wikipedia, um.
"My way is the way of not fighting":- the book of Enter the Dragon.
- gilesgoat
- Sheepie Whore

- Posts: 27258
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Conway's Life, Wikipedia, um.
Even better everyting can be described/done in ONE SINGLE LINE : https://aplwiki.com/wiki/Conway%27s_Game_of_Life
Giles the billy goat
"Baa"
"Baa"
- gilesgoat
- Sheepie Whore

- Posts: 27258
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Conway's Life, Wikipedia, um.
https://aplwiki.com/wiki/Conway's_Game_of_Lifegilesgoat wrote:Even better everyting can be described/done in ONE SINGLE LINE : https://aplwiki.com/wiki/Conway's_Game_of_Life
Giles the billy goat
"Baa"
"Baa"
- zip accident
- Sheepie Whore

- Posts: 13928
- Joined: Sun Feb 20, 2005 1:58 pm 0
- Location: Bristol, UK
Re: Conway's Life, Wikipedia, um.
My query was related to this bit:
Conway's Life is troublesome to program because you need the neighbours from the previous generation, so you can't just itterate over the screen altering stuff as you pass, because if you did you'd change some neighbours that you needed for calculations on cells you hadn't got to yet. My solution was two arrays mapped to the screen, which alternated between being the previous generation and the current one, then write the screen when the current generation was finished. That being so, I think it was more effective to write each cell once, rather than write every cell to dead then write in the live ones.
So, my version would be:
Any cell with 0,1,4,5,6,7 or 8 neighbours is dead.
Any cell with 3 neighbours is alive.
Any other cell (which can only have 2 neighbours) that was alive is alive.
A cell with 2 neighbours that was dead is dead.
There are more lines, but less testing, and it should be faster.
It may not matter on current processors, but on the 68000 or z80, that sort of inefficiency would make a program slow.Any live cell with two or three live neighbours survives.
Any dead cell with three live neighbours becomes a live cell.
All other live cells die in the next generation. Similarly, all other dead cells stay dead.
Conway's Life is troublesome to program because you need the neighbours from the previous generation, so you can't just itterate over the screen altering stuff as you pass, because if you did you'd change some neighbours that you needed for calculations on cells you hadn't got to yet. My solution was two arrays mapped to the screen, which alternated between being the previous generation and the current one, then write the screen when the current generation was finished. That being so, I think it was more effective to write each cell once, rather than write every cell to dead then write in the live ones.
So, my version would be:
Any cell with 0,1,4,5,6,7 or 8 neighbours is dead.
Any cell with 3 neighbours is alive.
Any other cell (which can only have 2 neighbours) that was alive is alive.
A cell with 2 neighbours that was dead is dead.
There are more lines, but less testing, and it should be faster.
"My way is the way of not fighting":- the book of Enter the Dragon.
- gilesgoat
- Sheepie Whore

- Posts: 27258
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Conway's Life, Wikipedia, um.
As far as I know ANY "cellular automata" where you have some rules as "Generation X+1 = F ( Generation X ) " requires TWO arrays "OLD" and "NEW" and then you swap PTRs between the two.
You compute "NEW" from "OLD" then "NEW" becomes "OLD" and "OLD" "NEW" and you repeat.
MAYBE , not able to think it "on the fly" now, MAYBE you can do something by "caching" only 9 lines of "NEW" at the time but then I suppose you'd had to copy those 9 lines from "new" to old.
The easiest route is always to have 2 arrays of "cell states".
You compute "NEW" from "OLD" then "NEW" becomes "OLD" and "OLD" "NEW" and you repeat.
MAYBE , not able to think it "on the fly" now, MAYBE you can do something by "caching" only 9 lines of "NEW" at the time but then I suppose you'd had to copy those 9 lines from "new" to old.
The easiest route is always to have 2 arrays of "cell states".
Giles the billy goat
"Baa"
"Baa"
Re: Conway's Life, Wikipedia, um.
I know there are life acceleration algorithms based on hashing that allow reasonable speed on unreasonably large grids. Also sparse representations that allow unlimited scaling.
I suspect that they would be too memory hungry for small computers though.
I suspect that they would be too memory hungry for small computers though.
- zip accident
- Sheepie Whore

- Posts: 13928
- Joined: Sun Feb 20, 2005 1:58 pm 0
- Location: Bristol, UK
Re: Conway's Life, Wikipedia, um.
What would you consider to be a small computer in this context?GoatFoam wrote:I know there are life acceleration algorithms based on hashing that allow reasonable speed on unreasonably large grids. Also sparse representations that allow unlimited scaling.
I suspect that they would be too memory hungry for small computers though.
"My way is the way of not fighting":- the book of Enter the Dragon.
Re: Conway's Life, Wikipedia, um.
the z-80 mentioned above is definitely too small, maybe the 68k. Hash life implementations were practical on the 486 DX-4 I had in the mid-late 90s.
- gilesgoat
- Sheepie Whore

- Posts: 27258
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Conway's Life, Wikipedia, um.
Ok this is another challenge for me .. do a life 256x192 on a ZX then .. I never done it ...
Giles the billy goat
"Baa"
"Baa"
- WiteWulf
- Sheepie Whore

- Posts: 10125
- Joined: Mon Aug 23, 2004 11:20 am 0
- PSN: WiteWulf
- Location: Loughborough(ish)
Re: Conway's Life, Wikipedia, um.
I wrote a very simple Mandelbrot renderer in OPL on a Psion 3a 30 years ago. Took about 2hrs to render a basic fully zoomed out image (480x160), iirc. The 3a had a 7.68MHz NEC V30H CPU 
:::G:::
PSN: WiteWulf
Switch: SW-3941-2878-7584
Steam: WITEWULF66
PSN: WiteWulf
Switch: SW-3941-2878-7584
Steam: WITEWULF66
- zip accident
- Sheepie Whore

- Posts: 13928
- Joined: Sun Feb 20, 2005 1:58 pm 0
- Location: Bristol, UK
Re: Conway's Life, Wikipedia, um.
No offence intended, but OPL must have been horribly bad, a basic PC could do that faster.WiteWulf wrote:I wrote a very simple Mandelbrot renderer in OPL on a Psion 3a 30 years ago. Took about 2hrs to render a basic fully zoomed out image (480x160), iirc. The 3a had a 7.68MHz NEC V30H CPU
"My way is the way of not fighting":- the book of Enter the Dragon.
- gilesgoat
- Sheepie Whore

- Posts: 27258
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Conway's Life, Wikipedia, um.
I can't remember precisely but in SuperBasic at 256x256 resolution on a Sinclair QL @8Mhz took about 8 .. 10 hours to render a mandelbrot !!!WiteWulf wrote:I wrote a very simple Mandelbrot renderer in OPL on a Psion 3a 30 years ago. Took about 2hrs to render a basic fully zoomed out image (480x160), iirc. The 3a had a 7.68MHz NEC V30H CPU
Giles the billy goat
"Baa"
"Baa"

