Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Simulate 2^100 live automata cells in milliseconds, in your browser (ekzhang.com)
13 points by ekzhang on May 27, 2020 | hide | past | favorite | 2 comments


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.


A discussion of the Hashlife algorithm in DrDobbs, https://www.drdobbs.com/jvm/an-algorithm-for-compressing-spa...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: