Categories
BLOG

game of life pulsar

Game of life pulsar

This is an implementation of Conway’s Game of Life or more precisely, the super-fast Hashlife algorithm, written in JavaScript using the canvas -tag. It can simulate the largest known patterns, including the Tetris Processor (0.1MB, 29201m cells), Caterpillar (2.5MB, 11m cells), Gemini (1.4MB, 846k cells), Turing Machine (0.1MB, 252k cells) and large Metapixel patterns (0.1MB, 100m cells).

If you encounter any bugs or have feedback, you can contact me at this email.

Click on the pattern name on the bottom left to get some informations about the current pattern.

Controls:External links

  • LifeWiki
  • ConwayLife forums
  • Golly — A desktop life viewer

A JavaScript version of Conway’s Game of Life, based on the Hashlife-algorithm.

Conway’s Game of Life

I figured a good learning exercise for checking out would be to implement a small example of Conway’s Game of Life using the canvas for drawing. Here’s the result.

This implementation has a small twist, where as a particular cell stays alive through generations (i.e., as it ages), the shade of the cell gets darker until it turns black.

Start out by clicking grid cells to create an initial pattern, or use of the sample patterns below. Once the initial pattern is set, click ‘Go’ to start the game.

Some initial patterns to try:

  • Still lives – Nothing generated, nothing dying
  • Basic 2-period oscillators
  • Pulsar – 3-period oscillator
  • Pulsar generator – Eventually generates a pulsar
  • R-pentomino – Lots of complexity from 5 initial cells. Eventually stabilizes arounf gen 250
  • Pentadecathlon – A 15-period oscillator
  • Queen Bee Shuttle – 30-period oscillator where a queen bee travels between two blocks.
  • 2 Lightweight space ships – The bottom one turns into a glider when it reaches the edge
  • Flower of Eden – Dissolves into nothing, but pretty

Conway’s Game of Life I figured a good learning exercise for checking out would be to implement a small example of Conway’s Game of Life using the canvas for drawing. Here’s the result. This