A ruby implementation of Conway's game of life.
$ gem install life
To use Life, run the
life new command. It can be used with the following options
-wspecifies how many cells wide the game will be
-hspecifies how many cells high the game will be
-gspecifies how many generations the simulation will run
- '--seed' or '-s' is the initial pattern of the game. Pass coordinate pairs using the following pattern:
x:y x:y x:y ...
$ life new -w 3 -h 4 -g 5 -s 3:2 1:1
This will create a 3x4 game that runs for 5 generations. The live cells in the starting pattern are
You can use a random initial pattern if you don't feel like building one yourself. Options are the same as for the new method except that no seed is passed. All of the options are optional. If you don't pass in a value it will default to a 30x30 grid for 100 generations.
$ life random -w 10 -h 10 -g 5
$ life random
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request