https://github.com/oieioi/lifegame.rb
🦠Ruby CLI implementation of Conway's Game of Life.
https://github.com/oieioi/lifegame.rb
ruby rubygem
Last synced: 9 months ago
JSON representation
🦠Ruby CLI implementation of Conway's Game of Life.
- Host: GitHub
- URL: https://github.com/oieioi/lifegame.rb
- Owner: oieioi
- License: mit
- Created: 2019-11-21T10:56:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-22T12:14:03.000Z (over 6 years ago)
- Last Synced: 2025-10-07T22:32:07.800Z (9 months ago)
- Topics: ruby, rubygem
- Language: Ruby
- Homepage: https://rubygems.org/gems/lifegame
- Size: 169 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Lifegame
Ruby CLI implementation of [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).
demo: `git clone` and `bundle install` and `bundle exec ./bin/demo`
[](./demo.gif)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'lifegame'
```
And then execute:
```
$ bundle install
```
Or install it yourself as:
```
$ gem install lifegame
```
## Usage
```ruby
# 20 x 50
game = Lifegame::Game.new(20, 50)
# eg: grader
game[2,7].be!; game[2,8].be!; game[2,9].be!; game[1,7].be!; game[0,8].be!
# print
puts game
# next
game.next!
puts game
# autoplay
game.start
# random with alive frequency
game.sow!(0.2)
game.start
```
or `gem install lifegame` and on your shell
```sh
$ lifegame
```
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).