Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nnbnh/life.rb
⠬⠆My simple "Conway's Game of Life" in Ruby
https://github.com/nnbnh/life.rb
cli-game game-of-life gameoflife ruby tui-game
Last synced: about 1 month ago
JSON representation
⠬⠆My simple "Conway's Game of Life" in Ruby
- Host: GitHub
- URL: https://github.com/nnbnh/life.rb
- Owner: NNBnh
- License: gpl-3.0
- Created: 2022-05-17T13:03:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-28T15:37:28.000Z (about 2 years ago)
- Last Synced: 2024-10-15T06:34:49.774Z (3 months ago)
- Topics: cli-game, game-of-life, gameoflife, ruby, tui-game
- Language: Ruby
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Conway's Game of Life
But in Ruby
## ⌨️ Usage
Download [the file](https://github.com/NNBnh/life.rb/blob/main/life.rb) then load it in `irb`:
```rb
require_relative "path/to/life"
```For convenience, use this board generator:
```rb
def universe_gen(d = 16, r = 0.1) d = [d, d] if Array(d).one?; Array.new(d[1]) { Array.new(d[0]) { rand <= r } } end
```Then start the simulation:
```rb
GameOfLife.new(universe_gen([64, 32], 0.075)).play
```## 💌 Credits
Special thanks to:
- [**APL + Game of Life = ❤️**](https://www.youtube.com/watch?v=pMslgySQ8nc) by [Code_report](https://www.youtube.com/channel/UC1kBxkk2bcG78YBX7LMl9pQ)
- [**Game of Life**](https://wikipedia.org/wiki/Conway's_Game_of_Life) by [John Horton Conway](https://wikipedia.org/wiki/John_Horton_Conway)
---
>
Made with ❤️ by NNB
>
>