mwvdlee ·
Hi y'all.
Just got back from class and on the drive home I was wondering how hard it would be to implement Conway's Game of Life in S|M. Turns out it's not really that hard at all; I've spent just over an hour on this one.
Click the Reset control to load the initial state, click the Step control to iterate one step.
Ideally, the display could be hooked up to the mouse, so you could manually edit the state, but this is enough for now.
The implementation does have some trouble at the borders, but this really can't be fixed. Life is supposed to run on an infinite size grid and obviously infinity is a bit too much to ask of S|M 😉 No matter how far you stretch the grid outside view, there will always be practical limits.
For those who do not understand the significance of Conway's Game of Life; it's basically an automata proven to be capable of simulating a Turing machine. For those who don't know the significance of that; a Turing machine is a theoretical machine mathematically proven to be capable of solving any algorithm. Both require infinite memory, but for practical purposes, any amount of memory will do.
Simply put; being able to run Conway's Game of Life means proving you can run any algorithm. Ignoring performance and easy-of-use, this means S|M is as capable of as C++, Java, C# or any other language, as long as it can fit in memory. So no more excuses that you can't implement an algorithm in S|M; you have been mathematically proven wrong 😉