Skip to content

satyaveni299/gameoflife

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conway's Game of Life

What is it?

Conway's Game of Life, or simply "Life," is a cellular automaton devised by British mathematician John Horton Conway in 1970. It is a zero-player game, meaning its evolution is determined by its initial state, requiring no further input. Players interact with the game by creating an initial configuration and observing how it evolves. The game is Turing complete and can simulate a universal constructor or any other Turing machine.

The Universe

The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells,

Each cell is in one of two possible states, ALIVE or DEAD.

Every cell interacts with its eight neighbors, which are the cells that are horizontally, vertically, or diagonally adjacent.

The Rules

  1. Any live cell with fewer than two live neighbors dies, as if by 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, as if by overpopulation.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

The first generation is created by applying the above rules simultaneously to every cell in the seed, alive or dead; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick. Each generation is a pure function of the preceding one.

The Game

The Canvas / Grid

Buttons What they do
Starts the animation after you've set the initial pattern
Pauses the animation
Increases the speed of the animation
Decreases the speed of the animation
Clear Clears the grid on click, only if the game is not animating at that moment
Random Randomly initializes the grid with initial randomness as 20%

The Settings

Settings What are they for?
Gridlines Toggles visibility of the gridlines
Warp on Edges Warps the patterns across the edges - Initially set as true
Randomness Allows you to set custom randomness percent for random initialization

The Themes

Themes The Colors
Blue (default) #0f045a #7582b2 #036c96 #ebf2ff #352a7e #101536 #080126 #c6cede #00246B #CADCFC
Red #5a0404 #B27575 #960320 #FFEBEB #7E2A37 #361015 #260106 #DEC6C6 #6b0000 #fccaca
Green #045a1e #75B289 #03962f #EBFFEF #2A7E4D #10361C #01260B #C6DECC #006b2b #cafcdd
Purple #5a045a #B275B2 #960396 #FFEBFF #7E2A7E #361036 #260126 #DEC6DE #6b006b #fcafcf
Dark Cyan #045a5a #75B2B2 #039696 #EBFFFF #2A7E7E #103636 #012626 #C6DEDE #006b6b #cafcfc

History

Also stores history of patterns that user has played with, up to 5 recent patterns

The Presets

Glider

The glider is the smallest, most common, and first-discovered spaceship in Game of Life. It travels diagonally across the grid, Gliders are important because they are easily produced (by glider guns and rakes) can be collided with each other to form more complicated patterns, and can be used to transmit information over long distances.

Small Glider

Big Glider

The big glider was found by Dean Hickerson in December 1989 and was the first known diagonal spaceship other than the glider. Two gliders can be temporarily seen at the front of the ship; these do not stay gliders but still move like them.

Big Glider

Gosper Glider Gun

The Gosper glider gun is the first known gun, and indeed the first known finite pattern with unbounded growth, found by Bill Gosper in November 1970. It consists of two queen bee shuttles stabilized by two blocks.

Gosper Glider Gun

More Configurations

https://conwaylife.com/wiki/Category:Patterns

The Resources

Spark your interest

https://www.youtube.com/watch?v=R9Plq-D1gEk

https://youtu.be/C2vgICfQawE?si=yWqN0BOSBOMaujkI

Also try playing it here

https://playgameoflife.com/

https://conwaylife.com/

Further Reading

https://conwaylife.com/wiki/

https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

Footnote

Conway's Game of Life is a fascinating exploration of life, death, and the rules that govern them. Despite its simplicity, it can lead to complex and beautiful patterns.

Game of Life offers a unique way to explore the unpredictable beauty of life itself.

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 55.5%
  • HTML 23.8%
  • CSS 20.7%