๐Ÿ“ฆ obafemitayor / game-of-life-app

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
๐Ÿ“ฅ Clone https://github.com/obafemitayor/game-of-life-app.git
HTTPS git clone https://github.com/obafemitayor/game-of-life-app.git
SSH git clone git@github.com:obafemitayor/game-of-life-app.git
CLI gh repo clone obafemitayor/game-of-life-app
Omotayo Obafemi Omotayo Obafemi Additional refactoring 7e03c93 1 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ game_of_life.rb
๐Ÿ“„ Gemfile
๐Ÿ“„ Gemfile.lock
๐Ÿ“„ main.rb
๐Ÿ“„ README.md
๐Ÿ“„ README.md

Conway's Game of Life

This is a simple implementation of the Conway's Game of Life written with Ruby. The application is a console app that allows the player to either select a blinker, block or a glider pattern, and keeps displaying the next state as long as the player presses enter. For now, the initial states of the game is hard coded but the core logic is built to display any pattern.

Introduction

Conway's Game of Life is a cellular automaton that simulates the evolution of a grid of cells over time based on a set of simple rules. Each cell can be either alive or dead, and its state in the next generation is determined by the states of its neighboring cells.

Code Structure

  • The entry point of the application is ``main.rb`. It is what loads the game and it does this by calling the `GameOfLifeApp` class in the `game_of_life_app.rb` file. 2. The `game_of_life_app.rb` file contains the I/O logic of the application. This is where the console interaction with the user happens. 3. The `game_of_life.rb`file contains logic that displays the board and calculates the next state of the board. 4. The tests folder contains both the unit test and integration test ## Installation To run the application, follow these steps: 1. Install Ruby. If You do not have Ruby installed, then you will need to install Ruby 2. Go to the root directory and run `bundle install%%CODEBLOCK0%%ruby main.rb%%CODEBLOCK1%%ruby tests/test_game_of_life_unit.rb%%CODEBLOCK2%%rspec tests/test_game_of_life_integration.rb``