This is a JavaScript implementation of Conway's Game of Life. The game is implemented client-side using HTML, CSS, and JavaScript (ES6).
The Game of Life is played on a two-dimensional grid of square cells. Each cell can be either alive or dead. The game progresses in generations, where each generation is determined by applying specific rules to the current state of the grid.
The rules for determining the next state of a cell are as follows:
- Any live cell with fewer than two live neighbors dies (underpopulation).
- Any live cell with two or three live neighbors lives on to the next generation.
- Any live cell with more than three live neighbors dies (overcrowding).
- Any dead cell with exactly three live neighbors becomes a live cell (reproduction).
To run the Game of Life, follow these steps:
- Clone the repository from GitHub:
git clone https://github.com/hadasaGIT/Seeking-Alpha-Test.git- Open the project folder:
cd Seeking-Alpha-Test-
Open the
index.htmlfile in a web browser. -
The initial configuration of the grid will be random for every page refresh. The grid will automatically tick and update every ~0.4 seconds based on the rules of the game.
The project structure is as follows:
game-of-life/
├── index.html
├── css/
│ └── style.css
└── js/
└── script.jsindex.html: The main HTML file that renders the grid.css/style.css: The CSS file that styles the grid and cells.js/script.js: The JavaScript file that implements the game logic.
Feel free to explore and modify the code to enhance the game or customize its behavior.
The fully functional code for the Game of Life can be found on GitHub: Link to GitHub Repository
Please note that the code provided is not modified or obfuscated and should work as expected.