Hi Vanessa,
don't you find it difficult to understand? I mean, I do not understand how it goes from the rules of the game (*) to that code... I can not map that implementation to the rules of the game... Can someone explain to me or point me to a paper/description of why that implementation works?
I did two implementations of the game a long time ago. One that goes over the board twice and another that goes only once.
These implementations try to be as declarative as possible. For example, the one that passes over the board twice is:
nextGeneration
aliveCells := self cellsToSurviveOnNextGeneration union: self cellsToResurectOnNextGeneration
The one that passes over the board once is:
nextGeneration
aliveCells := self boardCellsSelect: [ :aCell | self shouldBeAliveOnNextGeneration: aCell ]
aliveCells is a Set of the alive cells of the game. I think you can deduce what the other messages do.
Of course it is not as performant as Dan's implementation... If someone can direct me to some info or explain to me why Dan's implementation works I will appreciate it.
Thanks!
Hernan