|
|
|
|
|
by alainbryden
4994 days ago
|
|
I figured caching the results of common patterns appearing in blocks of 2x2, 3x3, 4x4, etc. pixels which are surrounded by all 'off' pixels, you can easily skip many repetitive calculations. ---- ----
-oo- =\ -oo-
-oo- =/ -oo-
---- ----
----- ----- -----
--o-- ----- --o--
--o-- =\ -ooo- =\ --o--
--o-- =/ ----- =/ --o--
----- ----- -----
------ ------ ------
-oo--- -oo--- -oo---
-oo--- =\ -o---- =\ -oo---
---oo- =/ ----o- =/ ---oo-
---oo- ---oo- ---oo-
------ ------ ------
Since repeating patterns tend to turn up a lot on their own in CGoL they would end up cached, and large blocks of n cells could be computed in 1 move rather than requiring o(8n) time. That seems to be how Hashlife works: http://en.wikipedia.org/wiki/Hashlife |
|
https://github.com/raganwald/cafeaulife