From daf7923286dba892e55b97f04521d39a4e665a1b Mon Sep 17 00:00:00 2001 From: Daniel Moura Date: Wed, 11 Oct 2023 19:22:26 -0300 Subject: [PATCH] add Conway's Game of Life --- Projects/1-Beginner/Game-of-Life.md | 45 +++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 46 insertions(+) create mode 100644 Projects/1-Beginner/Game-of-Life.md diff --git a/Projects/1-Beginner/Game-of-Life.md b/Projects/1-Beginner/Game-of-Life.md new file mode 100644 index 00000000..57b1d784 --- /dev/null +++ b/Projects/1-Beginner/Game-of-Life.md @@ -0,0 +1,45 @@ +# Conway's Game of Life + +**Tier:** 1-Simple + +Implement a web version of the [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life), using HTML/CSS and JS. You can use a library to help you such as [p5.js](https://p5js.org/). + +The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur: + +- Any live cell with fewer than two live neighbours dies, as if by underpopulation. +- Any live cell with two or three live neighbours lives on to the next generation. +- Any live cell with more than three live neighbours dies, as if by overpopulation. +- Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. + +These rules, which compare the behaviour of the automaton to real life, can be condensed into the following: + +- Any live cell with two or three live neighbours survives. +- Any dead cell with three live neighbours becomes a live cell. +- All other live cells die in the next generation. Similarly, all other dead cells stay dead. + +The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed, live or dead; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick.[nb 1] Each generation is a pure function of the preceding one. The rules continue to be applied repeatedly to create further generations. + +## User Stories + +- [ ] User can place a cell on a empty space +- [ ] User can delete a cell on a filled space +- [ ] User can run the game with a play button +- [ ] User can stop the game with a stop button +- [ ] User can reset the grid + +## Bonus features + +- [ ] User can start with a pre defined template +- [ ] User can save/load a new template +- [ ] User can switch between different color schemes + +## Useful links and resources + +- [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) +- [p5.js](https://p5js.org/) +- [MDN](https://developer.mozilla.org/en-US/) + +## Example projects +- [copy/life](https://github.com/copy/life) +- [pmav/game-of-life](https://github.com/pmav/game-of-life) +- [DaanMoura/game-of-life](https://github.com/DaanMoura/game-of-life) \ No newline at end of file diff --git a/README.md b/README.md index 2d209743..7749c07b 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ required to complete them. | [First DB App](./Projects/1-Beginner/First-DB-App.md) | Your first Database app! | 1-Beginner | | [Flip Image](./Projects/1-Beginner/Flip-Image-App.md) | Change the orientation of images across two axes | 1-Beginner | | [GitHub Status](./Projects/1-Beginner/GitHub-Status-App.md) | Display Current GitHub Status | 1-Beginner | +| [Conway's Game of Life](./Projects//1-Beginner/Game-of-Life.md) | Web implementation of Conway's Game of Life | 1-Beginner | | [Hello](./Projects/1-Beginner/Hello-App.md) | User native language greeting | 1-Beginner | | [IOT Mailbox Simulator](./Projects/1-Beginner/IOT-Mailbox-App.md) | Use callbacks to check your snail mail | 1-Beginner | | [JS Input Validation](./Projects/1-Beginner/Javascript-Validation-With-Regex.md) | Script to validate inputs entered by a user using RegEx | 1-Beginner |