Public Access
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:
1 parent
948087077d
commit
a91d2550d7
29 files changed
+1402
-31
No files matched your search
@@ -179,6 +179,15 @@ See README.md for the overview.
|
||||
so it can be edited; the built-in one is the fallback, and deleting the copy resets it.
|
||||
- Pages hold 16 elements (format 7). A `DynamicPage` is about 4 KB: allocate it with `new`, and reset
|
||||
it with `clearPage()`, not `page = DynamicPage()` (a temporary on the 8 KB loop stack).
|
||||
- Game of Life (`logic/life`, `display/life_player`): a page element without fields of its
|
||||
own: it reuses `bar_width/bar_height` (area), `format` (edges), `input_unit` (start),
|
||||
`text` (pattern / name start), `factor` (density), `scroll_speed`, `auto_unit`, `target`
|
||||
(max generations), `bar_max` (hold s); the list is in `logic/page.h`. JSON adds `start`
|
||||
and `generations`. One per page: `LifePlayer` keeps one board (about 7.5 KB) and ticks it
|
||||
in `FlipdotFrames::dynamicPage()`; reloading a page with the same start
|
||||
(`sameLifeStart()`) keeps it running. Rotating lists the icons only when
|
||||
`iconListRevision()` changes. The pattern library (RLE) is in the web page; check new
|
||||
patterns with a simulation before adding them.
|
||||
- HA attributes may be paths into lists (`forecast.1.condition`, `net/ha_api`). The
|
||||
forecast comes from the template sensor in `docs/home-assistant.md`.
|
||||
- `examples/home-pages.json` is written by `tools/export_examples.py` from the display.
|
||||
|
||||
Reference in new issue
Block a user