Skip to content

zameo94/game_of_life

Repository files navigation

README

Index

Intro

This simple Ruby on Rails console application reproduce the Conway's Game of life. You can find more details about visiting Wikipedia

This application was created to be as light as a possible.

There is no ActiveRecords or Migrations, not need a webserver or database, having the only goal of print (in console) the evolution of a matrix (following the Game of life rules) through a pattern like the example below:

Generation 3:
4 8
........
....*...
...**...
........

The only matrices allowed are those with a single digit number for both rows and columns (1...9)

Was tested on:

  • Ubuntu 20.04.3 LTS / Macos 12.3
  • Ruby 2.6.6
  • Rails 5.2.7

Prerequisites

  • Ruby 2.6.6
  • Rails 5.2.7

Installation

  • Download the project
git clone https://github.com/zameo94/game_of_life.git
  • Enter in the project's directory
cd game_of_life
  • Install gems
bundle install 

Congratulations, all are ready

If you want to run Rspec tests, just go in the project directory and type:

rspec spec

Play

This applications implements 2 examples. For prove them, just type the right command on the project's directory.

  • Example 1:

    rake game_of_life:run_sample
    

    File:

    Generation 3:
    4 8
    ........
    ....*...
    ...**...
    ........
    
  • Example 2:

    rake game_of_life:run_sample2
    

    File:

    Generation 1:
    5 5
    .....
    .....
    .***.
    .....
    .....
    

To stop the interactions, just type:

Ubuntu: ctrl + c
Macos: ^ + c

Enjoy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published