|
|
Version 0.8.0 Alpha
|
|
|
Portal to the Milescript open-source development community.
Milescript Demos - Life Demo
The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970 (Wikipedia). Organisms live, die, or are born based on four simple rules...
- A live cell with less than two neighbors dies by starvation.
- A live cell with four or more neighbors dies by over-population.
- A live cell with two or three neighbors survives.
- A dead cell with exactly three neighbors becomes alive.
To change things up a bit, we've added our own flavor to the game.
- A live cell changes color as it 'ages.' A new cell is yellow, a one cycle old cell is blue, a two cycle old cell is green, a three cycle old cell is orange, and the oldest cells are red.
- With Randomness Enabled, there is 0.5% chance that a live cell with exactly three neighbors dies and a 0.5% chance that a dead cell with exactly two neighbors becomes alive.
- The Screen wraps, creating an "unbounded" universe for the Organisms.
This demo illustrates the following Milescript features:
- Code Condensation
- Documentation Generation
- Generic Types
- Uses Libraries LibDom, LibUtil, LibPixelEngine
|
Click Start to see the organisms come to life. Draw anywhere on the screen to create or destroy organisms. Click Enable Randomness to introduce genetic mutation.
Download the source code in the example workspace.
|
|
|
|