diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 15:58:05 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 17:53:43 -0300 |
| commit | e9f9f65ace7650a02cee6bf2b2eb466522485834 (patch) | |
| tree | caf5b7a2344b8da002f3952e3225e0db38b492fc /addons/life | |
| parent | 75e4787be773c8cbfd2e60e59d409b9556898365 (diff) | |
| download | pardes-e9f9f65ace7650a02cee6bf2b2eb466522485834.tar.gz pardes-e9f9f65ace7650a02cee6bf2b2eb466522485834.zip | |
kinds #36, the five kinds on ABI 3: fake.c with every function (view painting each view's size, search through found, FakeJob cancel) and PA_PICTURES, snake, life and image over the module's prefix and open(path, bytes), image without a record (a Restore reads its file), and pdf.c ported mechanically (tick into pa_tick with its [P/N] prefix, a table of the views it is told, its strip laid out for the view its last key or click came from, the text layer painted for a window of glyphs and read on the tick while some view shows text, a body read keeping nothing, search through found, the record its fit, tint and place, PA_PICTURES); the goldens moved once, said in the report: the art words from the first frame, fake's view line, a pane ticked when opened or loaded, a view told after a frame re-wrapped its tag
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'addons/life')
| -rw-r--r-- | addons/life/life.out | 1 | ||||
| -rw-r--r-- | addons/life/life.zig | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/addons/life/life.out b/addons/life/life.out index 6e5b3f73..fb5a7b13 100644 --- a/addons/life/life.out +++ b/addons/life/life.out @@ -175,7 +175,6 @@ tag gen 3 alive 130 paused |........#.#...##.###........#... |.......###....#...##.....######. |.....##.##...................##. -|.....###....##.........#....###. > key r tag gen 0 alive 130 paused |.#.#.......##......#...#..#..... diff --git a/addons/life/life.zig b/addons/life/life.zig index 2ef26c56..2f459e07 100644 --- a/addons/life/life.zig +++ b/addons/life/life.zig @@ -22,7 +22,7 @@ const Life = extern struct { pub const head: addon.Head = .{ .name = "life", .version = 1, .words = &.{.{ .name = "Life", .opens = true, .doc = "a pane of Conway's Game of Life" }} }; - pub fn open(s: *Life, _: ?[]const u8) void { + pub fn open(s: *Life, _: ?[]const u8, _: ?[]const u8) void { s.seed = addon.seed(); s.reseed(); } @@ -47,9 +47,11 @@ const Life = extern struct { return true; } - pub fn paint(s: *Life, w: addon.Window, p: addon.Paint) void { - p.prefix("gen {d} alive {d}{s}", .{ s.gen, s.alive(), if (s.paused) " paused" else "" }); - for (s.cells, 0..) |row, y| for (row, 0..) |on, x| { + pub fn prefix(s: *const Life, w: *std.Io.Writer) !void { + try w.print("gen {d} alive {d}{s}", .{ s.gen, s.alive(), if (s.paused) " paused" else "" }); + } + + pub fn paint(s: *const Life, w: addon.Window, _: addon.Paint) void { for (s.cells, 0..) |row, y| for (row, 0..) |on, x| { const cursor = w.focused and x == s.cx and y == s.cy; w.put(x, y, if (on) "#" else ".", .{ .attrs = .{ .reverse = cursor } }); }; |
