Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (22 sloc) 1.11 KB
Simulate Game of Life using OCaml.
Reference: http://en.wikipedia.org/wiki/Conway's_Game_of_Life
Extension:
1. 2 ON states with different colors -> Immigration
2. Game: to eliminate all opponent's colors
3. Sound generator
4. Specify which initial region is life abundant
5. User control
============
> There are two versions: one in imperative style, "gol.ml", another in OO style, "gol_oo.ml"
> To compile: make -f gol_makefile. This will compile both source files.
> To run gol ve: ./gol arg1 arg2, where: arg1 is the number of lifecycles; arg2 is a float number indicating the initial portion of living cells.
For example: ./gol 40 0.8
> To run gol_oo: ./gol_oo arg1, where: arg1 is a float number indicating the initial portion of living cells. This an interactive plot, you press 'n' to see next generation, press 'q' to quit the program. The latest % of living population will show at command-line.
============
Release notes:
14-Nov-2012 v0.0
> Basic functionality
25-Nov-2012
> Fixed bug; implemented boundary cells
14-Dec-2012
> Added another version written in OO style "gol_oo.ml"