Game of Life on a Klein Bottle

This is a simulation of John Conway's game of life on the surface of a klein bottle. A klein bottle is a shape that you can only embed without intersections in a minimum of four dimensions, and is what happens when you take two Möbius strips (to make a Möbius strip you take a belt or something similar, make a loop out of it, but with a half turn in it so that when you run your finger along the surface of the strip, you go around twice (but on opposite ``sides'' each time) on the strip's one side to return to the original location). The game of life is an example of a cellular automata, and it has these rules:

  • A cell is either alive or dead.
  • A cell with exactly two living neighbors (neighbors are up, down, left, right, and the diagonals from a cell on a square grid) does not change in the next generation.
  • A cell with exactly three living neighbors is alive in the next generation.
  • Any other number of neighbors, and the cell is dead in the next generation.

In this simulation, cells which are alive in the current generation are white, and then if they turn off they turn blue and then fade to black. Cells which alive for many generations in a row, however, turn red after a while.