I made this simple 2D simulation of life using Rust. I find it fascinating to see how complex patterns can emerge from simple rules, and how well natural selection works!
The code is not extremely pretty, but I'm happy with the results. I'm quite amazed that I was able to port the whole thing to the web with very little effort!
Square indicates intelligence, which allows them to move non randomly towards the nearest edible biot (it’s on the page right after the bullet points).
This is neat! The simulation didn't remain "stable" for me for very long though; biot count pushed over 3000 and I dropped to just a few fps. I'm on a phone and I'm also a bit color blind so I'm probably not the ideal use case.
Believe it or not, there is an annoying bug in the R* tree crate I use that causes it to occasionally panic. I added a very ugly workaround that seems to work quite well though :)
That would be great. Another awesome screensaver is called substrate and included in the set 1) by Jamie Zawinski ( among the founders of Netscape and Mozilla ).
This is closer to real life than Conway's algorithm. Biots are able to move freely, have a very simple genome that gives them unique characteristics, and natural selection does the rest. There is a succinct description of the rules at the bottom of the demo page.
34 comments
[ 0.96 ms ] story [ 1441 ms ] threadThe code is not extremely pretty, but I'm happy with the results. I'm quite amazed that I was able to port the whole thing to the web with very little effort!
Is the "biot" name a reference to Rendezvous with Rama?
I'm not certain it would improve things, though, as the most time-consuming step is computing interactions between biots.
Edit: It looks like running it locally on X11 is trivial, so this should be easy to do. I'm trying to hack it together now :-)
But I've opened an issue upstream to track functionality in the renderer that would allow this[1].
[1]: https://github.com/not-fl3/miniquad/issues/250
1) https://www.jwz.org/xscreensaver/
jwz's default redirect for HN is well known[1] (and, IMO, apt).
[1]: https://news.ycombinator.com/item?id=25801699
Also how did you compile rust code for the web? And were there any challenges with it like weird browser issues?