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.
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.