
Show HN: Simulate 2^100 live automata cells in milliseconds, in your browser - ekzhang
https://www.ekzhang.com/game-of-life/
======
ekzhang
Some time ago I learned about the Hashlife algorithm, which computes the time-
evolution of a pattern in Conway's game of life in time _logarithmic_ in the
dimensions and number of iterations, given enough structure. This seems pretty
amazing to me - you can simulate a ridiculous amount of cells without much
computational power at all.

The standard Game of life viewer is called Golly, and it also uses this
algorithm. However, I was curious as to whether I could implement it
effectively in the browser - and this is the result (the answer is yes!).

Recommended: Select some large patterns (such as "Turing machine" or "Breeder
1") in the website, increase the speed and step size, and watch the magic
happen.

This experiment has a custom Hashlife implementation in JavaScript, with an
interface made using Vue and a browser canvas. The code is available at
[https://github.com/ekzhang/game-of-life](https://github.com/ekzhang/game-of-
life).

~~~
brudgers
A discussion of the Hashlife algorithm in DrDobbs,
[https://www.drdobbs.com/jvm/an-algorithm-for-compressing-
spa...](https://www.drdobbs.com/jvm/an-algorithm-for-compressing-space-
and-t/184406478)

