Skip to content

About

Conway's game of life

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life

A browser-based implementation of Conway's Game of Life — a zero-player cellular automaton where patterns evolve based on simple rules.

Features

  • Interactive grid — Click or drag to draw/erase cells, even while the simulation is running
  • Adjustable speed — Control simulation FPS (1–60) with a slider
  • Resizable grid — Change grid dimensions (30–150) on the fly
  • Preset patterns — Glider, Gosper Gun, Pulsar, and Random fill
  • Step mode — Advance one generation at a time
  • Live stats — Generation counter and population tracker
  • Keyboard shortcuts — Space (start/stop), N (next step), C (clear)
  • Responsive design — Works on desktop and smaller screens
  • Zero dependencies — No external libraries required

Rules

  1. A living cell with fewer than 2 neighbors dies (solitude)
  2. A living cell with 2 or 3 neighbors survives
  3. A living cell with more than 3 neighbors dies (overpopulation)
  4. An empty cell with exactly 3 neighbors becomes alive

The grid wraps around (toroidal topology), so cells on edges connect to the opposite side.

Getting Started

Open GameOfLife.html in any modern browser. No build step or server needed.

Controls

Action Mouse/UI Keyboard
Draw/erase cells Click or drag on grid —
Start simulation Start button Space
Stop simulation Stop button Space
Step forward Step button N
Clear grid Clear button C
Change speed Speed slider —
Change grid size Grid Size slider —
Load pattern Pattern buttons —

Project Structure

├── GameOfLife.html      Main page
├── css/
│   └── style.css       Custom styles (dark theme, layout)
├── js/
│   └── game_of_life.js Game logic and rendering
└── README.md

License

MIT

About

Conway's game of life

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages