Skip to content

sidcraftscode/game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Conway's Game of Life

A simple implementation of Conway's Game of Life using JavaScript and HTML Canvas.

Rules of the Game

Conway's Game of Life is a cellular automaton with simple rules:

  1. Any live cell with fewer than two live neighbors dies (underpopulation)
  2. Any live cell with two or three live neighbors lives on to the next generation
  3. Any live cell with more than three live neighbors dies (overpopulation)
  4. Any dead cell with exactly three live neighbors becomes a live cell (reproduction)

How to Use

  1. Open index.html in your web browser.
  2. Click on the grid to toggle cells between alive and dead.
  3. Click and drag to draw living cells.
  4. Use the buttons to control the simulation:
    • Start: Begin the simulation
    • Stop: Pause the simulation
    • Clear: Clear all cells from the grid
    • Random: Create a random pattern

Keyboard Shortcuts

  • Space: Toggle simulation play/pause
  • C: Clear the grid
  • R: Generate a random pattern
  • G: Add a glider pattern

About This Implementation

This is a hand-crafted implementation with features:

  • Toroidal grid (edges wrap around)
  • Drawing by clicking and dragging
  • Keyboard shortcuts
  • Adjustable speed

Enjoy watching patterns evolve and creating your own cellular automata!

About

A simple implementation of Conway's Game of Life using JavaScript and HTML Canvas.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published