requiescat in pace
Game of Life in memoriam John Horton Conway (26 December 1937 – 11 April 2020). Another victim of the pandemic.
This is a very basic implementation I hacked together in an hour or so. It does not represent my best work and it is done in JavaScript, which is not so much a programming language as it is a nightmare, so...
As you can see, there are some bugs, mainly that the outermost cells are always defined as not alive, so anything that hits these "walls" will behave strangely. (I did this so I wouldn't have to deal with wrap-arounds.) Also, there is no guarantee that every patter will behave as it should. The game board is 60x60 cells, but you can easily adjust that in the source code. Be aware that (hight==width) though. And the board is too small for Acorn, so best avoid it!
Another small little insignificant problem: It works great in Firefox, but Chrome takes forever for each iteration. At least for me. I have tried to optimize the whole drawing, but I guess painting filled rectangles onto a canvas just takes time even on modern PCs.
BTW: There is a whole Wiki dedicated to Life. Didn't know that.
Kommentare
Ansicht der Kommentare: Linear | Verschachtelt