Game of Life page element and built-in page

A new page element runs Conway's Game of Life in an area (the whole display
by default), one per page. Start: random dots, one pattern, or the icons
whose names start with a text in turn or in random order. Edges: wrap
around, dead, or a hidden margin where gliders fly out of view (leftovers
that stay put in the margin are cleared, so a glider gun runs cleanly).
It restarts when the board is still or repeats within 16 generations
and/or after a number of generations, after a hold time (an empty board
at once).

logic/life holds the board and timing (tested), display/life_player runs
the board of the shown page, ticked before each frame; frames are paced
like scrolling text. The element reuses existing fields, so the page
format stays the same. The Icons tab has a library of 17 LifeWiki
patterns (checked with a simulation), and the built-in page "Game of
Life" shuffles through the life_ icons. About 12 KB flash, 8 KB RAM.

Version 2.17.0, tested on the display over OTA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-20 17:52:25 +02:00
1 parent 948087077d
commit a91d2550d7
29 files changed
+1402 -31

No files matched your search

+4 -1
View File
@@ -6,7 +6,8 @@
#include "config.h"
#include "display/text.h"
FlipdotFrames::FlipdotFrames(BROSE9323 &display, PageResources &resources) : _display(display), _resources(resources)
FlipdotFrames::FlipdotFrames(BROSE9323 &display, PageResources &resources, LifePlayer &life)
: _display(display), _resources(resources), _life(life)
{
}
@@ -14,6 +15,7 @@ FlipdotFrames::FlipdotFrames(BROSE9323 &display, PageResources &resources) : _di
uint32_t FlipdotFrames::dynamicPage(const LocalTime &time, uint32_t now, bool redraw)
{
uint8_t bitmap[BITMAP_BYTES];
_life.tick(now);
uint32_t wait = renderPage(_dynamic, time, now, _resources, bitmap);
bool moving = wait != 0;
// The Nano has no acknowledgement: the next frame waits until it has received this one
@@ -84,6 +86,7 @@ void FlipdotFrames::off()
void FlipdotFrames::setDynamicPage(const DynamicPage &page)
{
_dynamic = page;
_life.setPage(page);
}
void FlipdotFrames::setPageBitmap(const uint8_t *bitmap)