Shop OBEX P1 Docs P2 Docs Learn Events
Game of Life on 8x8 Matrix -- with scrolling text — Parallax Forums

Game of Life on 8x8 Matrix -- with scrolling text

JonnyMacJonnyMac Posts: 9,104
edited 2020-04-16 02:51 in Propeller 2
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.

Comments

  • cgraceycgracey Posts: 14,155
    Looks good, Jon.
  • Well that looks familiar, except I did it on the charlieplexed board for the P2 Eval. You don't seem to be detecting extinction or repetition. My version does that, then has the much shorter banner just LIFE before restarting with a new random pattern. It's really unusual for pattern to run without going dark or repeating more than 30 seconds or so on an 8x8 grid.
  • Not yet. This was really more about dealing with a silly glitch in the 8x8 matrix I'm using and testing the driver code for the HT16K33.

    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?
  • Cool tribute Jon.
Sign In or Register to comment.