Public Access
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>
22 lines
936 B
C
22 lines
936 B
C
#pragma once
|
|
|
|
#include "logic/page.h"
|
|
|
|
// The original dynamic pages. display/page_store stores a copy of each at boot that can be
|
|
// edited; the original is the fallback (deleting the copy resets the page).
|
|
//
|
|
// Clock Pikachu with the time in a thought bubble, yawning from 17:00 (the clock
|
|
// of the old firmware; also the default page)
|
|
// Game of Life Conway's Game of Life on the whole display: the life_ icons (the
|
|
// patterns of the Icons tab) in random order, random dots without them
|
|
|
|
#define BUILTIN_PAGE_CLOCK "Clock"
|
|
#define BUILTIN_PAGE_LIFE "Game of Life"
|
|
|
|
int builtinPageCount();
|
|
const char *builtinPageName(int index);
|
|
// The built-in name as it is written, nullptr when it is no built-in page
|
|
const char *builtinPageName(const char *name);
|
|
// False when there is no built-in page with this name (compared without case)
|
|
bool builtinPage(const char *name, DynamicPage &page);
|