Skip to content

Michelprogram/game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Game of Life

Clone of the Conway's Game of Life


Table of Contents
  1. 🧭 About The Project
  2. 📋 Getting Started
  3. 💾 Usage
  4. 🔗 Contributing
  5. 📰 License
  6. 📫 Contact
  7. ⛱️ Acknowledgments

🧭 About The Project

🏗️ Built With

List of technologies / frameworks used during the project.

⬆️

📋 Getting Started

This project was given by a class teacher during my master degree. I learned how to work with mindset of TDD (Test driven development), and clean code based on the book.

You can find more information about TDD here : https://fr.wikipedia.org/wiki/Test_driven_development

Clean code book by Richard C. Martin : https://www.oreilly.com/library/view/clean-code-a/9780136083238/

🗺️ Prerequisites

You need JDK 16 for running this project.

Get JDK at this url : https://openjdk.org/projects/jdk/16/

⬆️

💾 Usage

In this project you'll find 3 Class.

Grid

Grid class contain 2 dimensions arrays represent by a board game, you can instance two types of Grid.

  1. With column, row and number of generation
    • The board is initialed with random Cell Alive or Dead at 50% each.
  2. Based on figure, check the file enumeration Figures for more information
    • The board is initialed with dead Cell
    • Than fill to create shape

Also, you have 2 types of running game. First depend on number of generation and second stop when all cells are dead.

The main part of this class is scan. Scan over whole board and store new value in a new board and set old board with the new one at the end.

Cell

Cell class is related about cells contain in the board inside Grid class.

You have 2 types of constructor.

  1. You can choose if cell is alive or not
  2. IsAlive parameter is chosen randomly 50%

Rule method is based on this :

  • Each cell with one or no neighbors dies, as if by solitude.
  • Each cell with four or more neighbors dies, as if by overpopulation.
  • Each cell with two or three neighbors survives.
  • Each cell with three neighbors becomes populated.

Menu

Menu class part interact with user. You can choose over 5 options.

  1. Random game, you'll ask chose column, row and number of generation.
  2. Plane shape, the game start with the shape of Plane
  3. Flashing shape, the game start with the shape of Flashing
  4. While everyone die, you'll ask chose column and row. The game will never end unless there is no cell.
  5. Quit the game

App

You can start the app inside App class, in main function.

Test

All the tests can be run in test folder. Each file test whole functionality for the class Grid and Cell.

⬆️

🔗 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

⬆️

📰 License

Distributed under the MIT License. See LICENSE.txt for more information.

⬆️

📫 Contact

Reach me at : gauron.dorian.pro@gmail.com.

Project Link: https://github.com/Michelprogram/21-planets.git

⬆️

⛱️ Acknowledgments

This space is a list to resources i found helpful and would like to give credit to.

⬆️

Template inspired by othneildrew

Releases

No releases published

Packages

No packages published

Languages