Game of Life on 8x8 Matrix -- with scrolling text
JonnyMac
Posts: 9,104
I wanted to do something with a little HT16K33-powered 8x8 matrix that I had around, so I did a small Game of Life. I also added scrolling text -- having seen that in another thread I was inspired to give it a go. My text is fixed width to keep things really easy. ATM, I can only have letters, numbers, and spaces in my scrolling string; I need to finish the character maps (liberated and modified from an Adafruit library).
The code isn't heavily commented, but it's very simple, so I don't think anyone will have trouble understanding what's happening.
Note: There is a glitch in the matrix that I'm using: The column LEDs are connected such that bits 0 though 6 are shifted up by one, at bit7 is displayed in the bit0 position. I created a little routine to fix this on displays with that problem (all of the units I have). The feature can be disabled by changing a constant.
Edit: I was chided a bit for not having colony death, static state, or dynamic state detection -- so those features are in now. The dynamic state (oscillation) detection is not idea; going to improve that.
The code isn't heavily commented, but it's very simple, so I don't think anyone will have trouble understanding what's happening.
Note: There is a glitch in the matrix that I'm using: The column LEDs are connected such that bits 0 though 6 are shifted up by one, at bit7 is displayed in the bit0 position. I created a little routine to fix this on displays with that problem (all of the units I have). The feature can be disabled by changing a constant.
Edit: I was chided a bit for not having colony death, static state, or dynamic state detection -- so those features are in now. The dynamic state (oscillation) detection is not idea; going to improve that.
Comments
I had thought about doing a CRC on the matrix at the end of each generation; if the current generation and the previous are a match, the colony is idle/dead. Then I though the CRCs could be put into a buffer to see if the current CRC showed up before; this would indicate it stuck in a repetitive loop.
What was your approach?
https://forums.parallax.com/discussion/comment/1464028/#Comment_1464028