Conway’s game of life


Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1619
Posted: 06:47am 26 Apr 2020      

Hi again Tom,

It took more than a couple of coffees but I think I have it worked out.

b=0 represents the 3 values of (x-1,y-1) , (x-1,y)  and (x-1,y+1)  which are off the edge and are zero according to the rules.
c is same but around x and
d is the same around x+1
Adj includes the value of the current cell which you take into account when updating the new matrix.
And then you maintain that moving window of 9 cells as you move along x.
b=c
c=d
And you only need to calculate d each time around the loop.
Is that correct?

For a printing version the screen update could be quicker if instead of a$ being used to print one line, an array a$(x,y) could hold the whole screen which could be printed in a FOR NEXT loop?

Bill
Keep safe. Live long and prosper.