TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Game of Life on non-square topologies with 2^32 update rules

69 pointsby jeadieover 2 years ago
Hi HN, when learning Golang (and topology), I ported a simple GOL in C (<a href="https:&#x2F;&#x2F;github.com&#x2F;Jeadie&#x2F;GoL" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Jeadie&#x2F;GoL</a>) into Go. I then added a bunch of features - Playing on other fundamental polygons (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fundamental_polygon#Examples_of_Fundamental_Polygons_Generated_by_Parallelograms" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fundamental_polygon#Examples_o...</a>) - Considering all possible update rules (of which, there are many).<p>Looking to get back to this project soon. Would love some feedback + ideas.

15 comments

symmetricsaurusover 2 years ago
I don&#x27;t understand the update rules as described in the readme.<p>In an 3x3 neighborhood there are 2^9, not 2^5 states. So we should get 2^512 possible update rules, not 2^32.<p>I think something similar is described in <a href="https:&#x2F;&#x2F;conwaylife.com&#x2F;wiki&#x2F;Rule_integer" rel="nofollow">https:&#x2F;&#x2F;conwaylife.com&#x2F;wiki&#x2F;Rule_integer</a>.<p>I&#x27;m not sure that all of those rules are valid. We must have translational invariance. One way to do that is to only update the state of the central cell in each considered neighborhood. In that case 2^9 rules are enough. Are there other ways to define consistent rules for a CA?
评论 #33505496 未加载
gpcr1949over 2 years ago
I may be misreading it, but doesn&#x27;t the GoL as commonly understood also depend on diagonal neighbors (i.e. 8 direct neighbors)? In that case the rule space would explode beyond the 32 bit integer one. (to a 256 bit one)
Aperockyover 2 years ago
Shameless (related) plug: Check out broader cellular-automata sim with custom update rules you can define in json (and run the game on the page itself).<p><a href="https:&#x2F;&#x2F;aperocky.com&#x2F;cellular-automata&#x2F;" rel="nofollow">https:&#x2F;&#x2F;aperocky.com&#x2F;cellular-automata&#x2F;</a><p>This allows for more &quot;block state&quot; too in addition to just the black and white for GOL. Also allows some time based rules (i.e. change based off block age that it stayed unchanged).<p>I&#x27;ve gravitated to essentially a file description (and the corresponding parser) to set up the rules - this makes making and adding rules easier.
评论 #33513287 未加载
评论 #33508958 未加载
chewxyover 2 years ago
Look up the b&#x2F;s format for specifying rules. It is a lot more flexible.<p>Here&#x27;s my version : <a href="https:&#x2F;&#x2F;github.com&#x2F;chewxy&#x2F;ll&#x2F;blob&#x2F;main&#x2F;main.go#L176" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;chewxy&#x2F;ll&#x2F;blob&#x2F;main&#x2F;main.go#L176</a><p>I also live coded this in a series of 3 videos:<p>1. <a href="https:&#x2F;&#x2F;youtu.be&#x2F;5JArQO8YeRo" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;5JArQO8YeRo</a> 2. <a href="https:&#x2F;&#x2F;youtu.be&#x2F;ZLUVAWb_31M" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;ZLUVAWb_31M</a> 3. <a href="https:&#x2F;&#x2F;youtu.be&#x2F;BIypQF7M9c8" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;BIypQF7M9c8</a><p>My approach differs from yours in that mine is entirely matrix driven.
sebstefanover 2 years ago
I don&#x27;t understand how the border topologies change the game of life compared to when it&#x27;s set on a regular plane<p>You say it can be played on a variety of manifolds, but if the topology of a manifold &quot;locally resembles Euclidean space near each point&quot;, considering that the game of life rules are always super local, then how does that change anything compared to a plane
评论 #33505167 未加载
评论 #33506275 未加载
评论 #33505177 未加载
KevinDonnotover 2 years ago
See also SmoothLife, an amazing continuous version of Game of life. Integers are replaced by floats providing the same patterns with circular shapes. Here: <a href="https:&#x2F;&#x2F;conwaylife.com&#x2F;wiki&#x2F;OCA:SmoothLife" rel="nofollow">https:&#x2F;&#x2F;conwaylife.com&#x2F;wiki&#x2F;OCA:SmoothLife</a>
评论 #33513312 未加载
bmc7505over 2 years ago
During a recent programming adventure, I discovered that finite elementary cellular automata with periodic boundary conditions can be simulated using matrix-vector multiplication with a circulant matrix and a strange kind of algebra, which I call a kernel algebra. [1] I wonder if this same idea could be generalized to higher dimensional automata on other topological surfaces.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;breandan&#x2F;galoisenne&#x2F;blob&#x2F;8f0f1e9e4e02062ce271f84afb1f8f2865cf1ff2&#x2F;src&#x2F;commonMain&#x2F;kotlin&#x2F;ai&#x2F;hypergraph&#x2F;kaliningraph&#x2F;automata&#x2F;ECA.kt#L63" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;breandan&#x2F;galoisenne&#x2F;blob&#x2F;8f0f1e9e4e02062c...</a>
tanepiperover 2 years ago
Playing on Klein bottles? That sounds like The Flower Game? <a href="https:&#x2F;&#x2F;www.destinypedia.com&#x2F;Flower_game" rel="nofollow">https:&#x2F;&#x2F;www.destinypedia.com&#x2F;Flower_game</a><p>(from <a href="https:&#x2F;&#x2F;www.destinypedia.com&#x2F;Garden" rel="nofollow">https:&#x2F;&#x2F;www.destinypedia.com&#x2F;Garden</a>)
Sharlinover 2 years ago
Missed the opportunity to call it Gogol :)
jdauriemmaover 2 years ago
You might also be interested in <a href="https:&#x2F;&#x2F;github.com&#x2F;bignimbus&#x2F;game-of-life-n" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bignimbus&#x2F;game-of-life-n</a>
zitterbewegungover 2 years ago
Golly is another way to explore 2d cellular automata and it also has a good UI. It is written in Python.
gwbas1cover 2 years ago
Videos!<p>I really don&#x27;t understand the diagrams, and how they relate to the shape that each diagram is labeled as.
eurasiantigerover 2 years ago
Can you extend it to non-uniform causal graphs with continuous state (as opposed to discrete)?
pohlover 2 years ago
Penrose tilings
erezshover 2 years ago
You can&#x27;t post something like that without screenshots. It&#x27;s against Internet law.
评论 #33504286 未加载
评论 #33504213 未加载