![]() I tried for nearly an hour to match the Black=living, White=dead scheme of Conway but couldn’t get that to work, maybe you can figure out how to do it. Green cells are “alive”, black ones are “dead”. The board size is fixed (see the configuration options at the beginning), whereas Conway’s version was played on a theoretically infinite grid. In my version, the rules for each cell are determined randomly, in advance of the game. It’s a variant of Conway’s Game of Life (not to be confused with the Milton Bradley version), where single celled lifeforms live or die based on how many living neighbors they have. The code below is my first test of using R to generate animations. So I picked R, with the idea that when I needed animations, I would find a way to build them. The drawbacks to Flash are that it is way behind R in terms of statistical tools, is a closed, expensive language to work with, and dispute widespread use it might be so weak that a single mobile computing company might kill it. Flash is also object oriented, well documented with hundreds of books and websites, and has a powerful (albeit challenging to learn) IDE which helps for large coding projects. It’s certainly possible to represent change and tell an evolving story with a single plot (see for example Tufte’s favorite infographic), but there are a lot more options when you can use animations. Most of my work involves evolutionary models that take place over time. On linux and mac it should be somewhere like /dev/ttyACM0.Before I decided to learn R in a serious way, I thought about learning Flash/Actionscript instead. After you get those parameters, funnel it to the display through the USB connection. Then run it from the commandline and pass it the parameters you want different from defaults at a minumum the wifi user and pass are needed. Compile the create_config.cpp file in the config folder. Create a secrets.h file with a couple of entries (allows you to default some wifi credentials if you want).Add the Adafruit boards via Preferences -> Additional Boards Manager URLs :.Adafruit Protomatter 1.4.1 - install all dependencies.Add some libraries to the IDE via the Library Manager.Update the ESP32 firmware so Wifi will work.If you just want the CircuitPython GOL then all you need to do is drag the code.py over to the drive and you are good to go.įor the Arduino code, you need to do a few things (assuming a Matrix Portal as the microcontroller): But was an interesting/easy attempt using palettes and in-code number arrays to represent images. And finally, the abomination that is "sprite rain" with possibly the worst small images ever created. Rain came next, that comes from northeast or northwest. Later the description from here ( ) was used for a proper simulation.Īfter that some questionable things were added :) What I call cars that just travel north/south/east/west starting at a random position and wrap. I had a really bad implementation based on a memory of boids from college, but they followed around aggressively and were boidish. And then there was time.Īfter a while of that and nights where I had to turn it off to sleep, I decided to reduce the colors at "night time" (10pm and 7am) to muted ones. The Matrix Portal microcontroller doesn't have a real time clock so I went with the next "best" thing of using the Wifi to ask an NTP server the time and use a GMT offset from that. I was blown away with the difference (try setting the fps to something like 60 I find 15 is a nice speed that allows you to see the changes and isn't too fast or slow).Īs I had that running and was mesmerized by the cells living and dying, I thought it would be neat to have it tell me the time. It was slow, so I decided to rewrite it in C++ with Arduino. ![]() It started as a test to see what Conway's Game of Life would look like after some coloring tweaks on Adafruit's RGB panel, kit here ( ). 3D models for a case that can be printed to house the panel and microcontroller.Configuration program (allows you to set, in persistent flash, configuration of various parameters that allow the arduino code to work).CircuitPython code (just a Game of Life simulation with colors based on how long a cell has been alive).Arduino code (all the logic for the clock and simulations).There are four main sections in the repo: It also changes the colors to more muted ones for night time, since it's hard to sleep in the same room with it otherwise. This is a cool clock that performs some simple simulations to keep you in a trance while you watch time fly. Game of Life (GOL) and Other Simulations in a Clock ![]()
0 Comments
Leave a Reply. |