Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Apliz/Makers2020_Game-Of-Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life

Ruby solution to John Conway's 'Life' celullar automaton.

Rules of life

  1. Any live cell with <2 live neighbours perishes.
  2. Any live cell with 2 || 3 live neighbours lives.
  3. Any live cell with >3 live neighbours perishes.
  4. Any dead cell with == 3 live neighbours comes alive.

Local usage

require and specify

>$ irb

  2.7.0 :001 > require './path_to_file/pattern.rb'
  2.7.0 :002 > require './path_to_file/board.rb'
  2.7.0 :003 > require './path_to_file/cell.rb'
  2.7.0 :004 > require './path_to_file/game.rb'

  2.7.0 :005 > game = Game.new

set start pattern loaf, toad and test are valid

>$
  2.7.0 :006 > game.condition('test')

run with period n

>$
  2.7.0 :007 > game.start(n)

Testing

Using rspec and simplecov for coverage

>$ rspec

User Stories

As a Developer,
To pay homage to the late Conway,
I would like to recreate the Game of Life.

As a Cell,
To be able to exist in my world,
I can detect the state of cells around me.

As a User,
To be able to interact with the game,
I can choose my starting conditions.

As a Cell,
To be able to grow,
I switch off if I have 3 live neighbours.

As a Cell,
To be able to perish,
I would like to switch off If I have more than 3; or less than 2 neighbours.

In the works

As a User,
So I can experiment,
I would like to upload grid configurations to the application.

As a User,
To be able to see the game,
I would like to visualise results in a command line interface.

About

Ruby solution to John Conway's Game of Life

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published