# GameOfLife This gem is an implementation of conway's game of life ## Installation Add this line to your application's Gemfile: ```ruby gem 'game_of_life' ``` And then execute: $ bundle Or install it yourself as: $ gem install game_of_life ## Usage ``` irb(main):002:0> require 'game_of_life' => true irb(main):003:0> game = GameOfLife::Earth.new(5,5,0.5) => #, #, #, #, #], [#, #, #, #, #], [#, #, #, #, #], [#, #, #, #, #], [#, #, #, #, #]]> irb(main):004:0> game.log => "Generation 1\n1 | 1 | 0 | 0 | 1\n0 | 0 | 1 | 1 | 0\n0 | 0 | 0 | 1 | 1\n0 | 0 | 0 | 0 | 1\n0 | 0 | 0 | 1 | 1\n" irb(main):005:0> puts game.log Generation 1 1 | 1 | 0 | 0 | 1 0 | 0 | 1 | 1 | 0 0 | 0 | 0 | 1 | 1 0 | 0 | 0 | 0 | 1 0 | 0 | 0 | 1 | 1 => nil irb(main):006:0> game.next! => nil irb(main):007:0> puts game.log Generation 2 0 | 1 | 0 | 0 | 0 0 | 0 | 1 | 0 | 1 0 | 0 | 0 | 0 | 1 0 | 0 | 0 | 1 | 0 0 | 0 | 0 | 1 | 1 => nil ``` ``` $ git clone https://github.com/aravind99/game_of_life.git $ cd game_of_life $ bin/game_of_life width:6 height:6 seed_probability:0.5 speed:1 ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/Aravind99/game_of_life. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).