Question: Using Javascript, HTML, and PHP create Conways game of life with the following requirements: Objective: The game of life is a grid of cells where
Using Javascript, HTML, and PHP create Conways game of life with the following requirements:
Objective: The game of life is a grid of cells where each cell is in the state of being alive or not. The next generation of the game depends on the current generation and the following rules: The game consists of a grid of cells, each of which can be alive or dead. For every cycle of the game, the cells can be turned on or off based on the following rules:
1. Any live cell with fewer than two live neighbors dies, as if caused by under population.
2. Any live cell with more than three live neighbors dies, as if by overcrowding.
3. Any live cell with two or three live neighbors lives on to the next generation.
4. Any dead cell with exactly three live neighbors becomes a live cell.
5. If a dead cell has exactly three live neighbors, it comes to life
6. If a live cell has less than two live neighbors, it dies
7. If a live cell has more than three live neighbors, it dies
8. If a live cell has two or three live neighbors, it continues living
Therefore by repeating the cycle over and over, these simple rules create interesting, often unpredictable patterns
1. Create a variable sized table.
2. The background color of the cells will determine life.
3. The cells can be turned on or off with the mouse.
4. Create a button for each of the following functions:
- 1. Start the game
- 2. Stop the game
- 3. Increment 1 generation
- 4. Increment 23 generations
- 5. Reset the game (Population=0 or other, Generation=0) Pattern button/Drop down selection to (Animate selection)
- 6. (choose 3 patterns --- (1) pattern from the Still life and Two Oscillators, Gliders are welcome and will be considered as a Bonus)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
