[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conway's game of Life, just because.

On 2019-05-07 19:29, Eli the Bearded wrote:
> In comp.lang.python, Paul Rubin  <no.email at nospam.invalid> wrote:
> Thanks for posting this. I'm learning python and am very familiar with
> this "game".
>> #!/usr/bin/python3
>> from itertools import chain
>> def adjacents(cell):            # generate coordinates of cell neighbors
>>     x, y = cell                 # a cell is just an x,y coordinate pair
>>     return ((x+i,y+j) for i in [-1,0,1] for j in [-1,0,1] if i or j)
> Elijah
> ------
> is the torus game board unintentional?
I've never seen a version of Conway's Game of Life where the board 
doesn't wrap around.