summaryrefslogtreecommitdiff
path: root/addons/life
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 14:36:54 -0300
committerGabriel Schneider <[email protected]>2026-11-06 14:53:45 -0300
commitb5bb5e8ccf71a5755dde95f04440ee9c6aaa18da (patch)
tree801403ea35508b571b34b0a750faed47be102f3d /addons/life
parent333cdea69956adda91f462980a18f5bac6548dda (diff)
downloadpardes-b5bb5e8ccf71a5755dde95f04440ee9c6aaa18da.tar.gz
pardes-b5bb5e8ccf71a5755dde95f04440ee9c6aaa18da.zip
kinds #28, the Life dogfood's fixes: Deadline.every steps a period from when it was due while that is under a period behind and re-arms a period from now when it is further behind or more than one ahead (a restored record's), which Life's catch-up and guard lines were and snake's 150 ms now keep without drift; the tick after a key or a focus is told the clock's now, not the last stepped frame's, which lags it while the next wake is to come (the core's, Kind.step: Life's resume no longer jumps four generations); ops refuses at compile time a word that opens no pane, there being no ctl, and its doc names the functions it handles; reference.typ says how a script's key, tick and size work and that a pane a dump loads is a new pane with a new seed, as the header now does
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.out372
-rw-r--r--addons/life/life.script5
-rw-r--r--addons/life/life.zig9
3 files changed, 191 insertions, 195 deletions
diff --git a/addons/life/life.out b/addons/life/life.out
index 07ed2a49..6e5b3f73 100644
--- a/addons/life/life.out
+++ b/addons/life/life.out
@@ -73,24 +73,164 @@ tag gen 2 alive 126
|......#.#.#.#.............#..##.
|.....##......#...........##.##..
> key x x
-tag gen 2 alive 126 paused
-|.#...........###......######....
-|#.#.......#####..#....##.##.....
-|.#......#...#####......#..#....#
-|#........##......#........#.....
-|...##....#.....#...#............
-|..##............###.....#..#....
-|...#.....#.###...#...#....#.###.
-|....#....#.....#....#..........#
-|..#.#......#...#...#.......##...
-|#.#...#.........#...#.........#.
-|.......#.....##.#....####.....##
-|.......#...##.#.#........###....
-|..........######..#.......#..#..
-|.#.....#.#........##......##....
-|......#.#.#.#.............#..##.
+tag gen 3 alive 131 paused
+|.#.........#...#......#.....#...
+|..#........#...................#
+|.#.............###....###.##...#
+|#.......###..#..................
+|..###....##.....................
+|..#.......#.#...###........###..
+|..###.....#.#....##........####.
+|....#......#..#.#...#.........#.
+|.#...#.........##..##..........#
+|.#.#..........#.#...####.....##.
+|......##....###.##...######...##
+|..........#.....##....######..#.
+|........#.#...##.###........#...
+|.......###....#...##.....######.
+|.....##.##...................##.
> tick 300
-tag gen 2 alive 126 paused
+tag gen 3 alive 131 paused
+|.#.........#...#......#.....#...
+|..#........#...................#
+|.#.............###....###.##...#
+|#.......###..#..................
+|..###....##.....................
+|..#.......#.#...###........###..
+|..###.....#.#....##........####.
+|....#......#..#.#...#.........#.
+|.#...#.........##..##..........#
+|.#.#..........#.#...####.....##.
+|......##....###.##...######...##
+|..........#.....##....######..#.
+|........#.#...##.###........#...
+|.......###....#...##.....######.
+|.....##.##...................##.
+> key lljx
+tag gen 3 alive 130 paused
+|.#.........#...#......#.....#...
+|...........#...................#
+|.#.............###....###.##...#
+|#.......###..#..................
+|..###....##.....................
+|..#.......#.#...###........###..
+|..###.....#.#....##........####.
+|....#......#..#.#...#.........#.
+|.#...#.........##..##..........#
+|.#.#..........#.#...####.....##.
+|......##....###.##...######...##
+|..........#.....##....######..#.
+|........#.#...##.###........#...
+|.......###....#...##.....######.
+|.....##.##...................##.
+> key k
+tag gen 3 alive 130 paused
+|.#.........#...#......#.....#...
+|...........#...................#
+|.#.............###....###.##...#
+|#.......###..#..................
+|..###....##.....................
+|..#.......#.#...###........###..
+|..###.....#.#....##........####.
+|....#......#..#.#...#.........#.
+|.#...#.........##..##..........#
+|.#.#..........#.#...####.....##.
+|......##....###.##...######...##
+|..........#.....##....######..#.
+|........#.#...##.###........#...
+|.......###....#...##.....######.
+|.....##.##...................##.
+> body
+=.#.........#...#......#.....#...
+=...........#...................#
+=.#.............###....###.##...#
+=#.......###..#..................
+=..###....##.....................
+=..#.......#.#...###........###..
+=..###.....#.#....##........####.
+=....#......#..#.#...#.........#.
+=.#...#.........##..##..........#
+=.#.#..........#.#...####.....##.
+=......##....###.##...######...##
+=..........#.....##....######..#.
+=........#.#...##.###........#...
+=.......###....#...##.....######.
+=.....##.##...................##.
+=.....###....##.........#....###.
+> dump
+dump 536 bytes
+tag gen 3 alive 130 paused
+|.#.........#...#......#.....#...
+|...........#...................#
+|.#.............###....###.##...#
+|#.......###..#..................
+|..###....##.....................
+|..#.......#.#...###........###..
+|..###.....#.#....##........####.
+|....#......#..#.#...#.........#.
+|.#...#.........##..##..........#
+|.#.#..........#.#...####.....##.
+|......##....###.##...######...##
+|..........#.....##....######..#.
+|........#.#...##.###........#...
+|.......###....#...##.....######.
+|.....##.##...................##.
+|.....###....##.........#....###.
+> key r
+tag gen 0 alive 130 paused
+|.#.#.......##......#...#..#.....
+|#.#......#......#......#.#......
+|.#.......##..##.....#...#...#..#
+|.....#..##.....#.#.#......#....#
+|#...#..........####....#.#......
+|..#.#.#....#.......#......###...
+|........##..#............#.....#
+|...#......##........#.......#...
+|...#.#.....#.###...#.###....#.##
+|##....#...#...#..#..#...##..#..#
+|..#..#.........#.........##...#.
+|.#..##.......#..#..#....#.#.....
+|..#..#...#.##....#.#..........##
+|..#...#..###..#...........#..#.#
+|....#......##.##..#.#.....#.#.#.
+> key h l
+tag gen 0 alive 130
+|.#.#.......##......#...#..#.....
+|#.#......#......#......#.#......
+|.#.......##..##.....#...#...#..#
+|.....#..##.....#.#.#......#....#
+|#...#..........####....#.#......
+|..#.#.#....#.......#......###...
+|........##..#............#.....#
+|...#......##........#.......#...
+|...#.#.....#.###...#.###....#.##
+|##....#...#...#..#..#...##..#..#
+|..#..#.........#.........##...#.
+|.#..##.......#..#..#....#.#.....
+|..#..#...#.##....#.#..........##
+|..#...#..###..#...........#..#.#
+|....#......##.##..#.#.....#.#.#.
+|..#..##.#.......##.....#...#....
+> tick 100
+tag gen 0 alive 130
+|.#.#.......##......#...#..#.....
+|#.#......#......#......#.#......
+|.#.......##..##.....#...#...#..#
+|.....#..##.....#.#.#......#....#
+|#...#..........####....#.#......
+|..#.#.#....#.......#......###...
+|........##..#............#.....#
+|...#......##........#.......#...
+|...#.#.....#.###...#.###....#.##
+|##....#...#...#..#..#...##..#..#
+|..#..#.........#.........##...#.
+|.#..##.......#..#..#....#.#.....
+|..#..#...#.##....#.#..........##
+|..#...#..###..#...........#..#.#
+|....#......##.##..#.#.....#.#.#.
+|..#..##.#.......##.....#...#....
+> tick 100
+tag gen 2 alive 126
|.#...........###......######....
|#.#.......#####..#....##.##.....
|.#......#...#####......#..#....#
@@ -106,10 +246,11 @@ tag gen 2 alive 126 paused
|..........######..#.......#..#..
|.#.....#.#........##......##....
|......#.#.#.#.............#..##.
-> key lljx
-tag gen 2 alive 125 paused
+|.....##......#...........##.##..
+> blur
+tag gen 2 alive 126
|.#...........###......######....
-|#.........#####..#....##.##.....
+|#.#.......#####..#....##.##.....
|.#......#...#####......#..#....#
|#........##......#........#.....
|...##....#.....#...#............
@@ -123,10 +264,11 @@ tag gen 2 alive 125 paused
|..........######..#.......#..#..
|.#.....#.#........##......##....
|......#.#.#.#.............#..##.
-> key k
-tag gen 2 alive 125 paused
+|.....##......#...........##.##..
+> tick 300
+tag gen 2 alive 126
|.#...........###......######....
-|#.........#####..#....##.##.....
+|#.#.......#####..#....##.##.....
|.#......#...#####......#..#....#
|#........##......#........#.....
|...##....#.....#...#............
@@ -140,28 +282,11 @@ tag gen 2 alive 125 paused
|..........######..#.......#..#..
|.#.....#.#........##......##....
|......#.#.#.#.............#..##.
-> body
-=.#...........###......######....
-=#.........#####..#....##.##.....
-=.#......#...#####......#..#....#
-=#........##......#........#.....
-=...##....#.....#...#............
-=..##............###.....#..#....
-=...#.....#.###...#...#....#.###.
-=....#....#.....#....#..........#
-=..#.#......#...#...#.......##...
-=#.#...#.........#...#.........#.
-=.......#.....##.#....####.....##
-=.......#...##.#.#........###....
-=..........######..#.......#..#..
-=.#.....#.#........##......##....
-=......#.#.#.#.............#..##.
-=.....##......#...........##.##..
-> dump
-dump 536 bytes
-tag gen 2 alive 125 paused
+|.....##......#...........##.##..
+> focus
+tag gen 2 alive 126
|.#...........###......######....
-|#.........#####..#....##.##.....
+|#.#.......#####..#....##.##.....
|.#......#...#####......#..#....#
|#........##......#........#.....
|...##....#.....#...#............
@@ -176,146 +301,21 @@ tag gen 2 alive 125 paused
|.#.....#.#........##......##....
|......#.#.#.#.............#..##.
|.....##......#...........##.##..
-> key r
-tag gen 0 alive 130 paused
-|.#.#.......##......#...#..#.....
-|#.#......#......#......#.#......
-|.#.......##..##.....#...#...#..#
-|.....#..##.....#.#.#......#....#
-|#...#..........####....#.#......
-|..#.#.#....#.......#......###...
-|........##..#............#.....#
-|...#......##........#.......#...
-|...#.#.....#.###...#.###....#.##
-|##....#...#...#..#..#...##..#..#
-|..#..#.........#.........##...#.
-|.#..##.......#..#..#....#.#.....
-|..#..#...#.##....#.#..........##
-|..#...#..###..#...........#..#.#
-|....#......##.##..#.#.....#.#.#.
-> key h l
-tag gen 0 alive 130
-|.#.#.......##......#...#..#.....
-|#.#......#......#......#.#......
-|.#.......##..##.....#...#...#..#
-|.....#..##.....#.#.#......#....#
-|#...#..........####....#.#......
-|..#.#.#....#.......#......###...
-|........##..#............#.....#
-|...#......##........#.......#...
-|...#.#.....#.###...#.###....#.##
-|##....#...#...#..#..#...##..#..#
-|..#..#.........#.........##...#.
-|.#..##.......#..#..#....#.#.....
-|..#..#...#.##....#.#..........##
-|..#...#..###..#...........#..#.#
-|....#......##.##..#.#.....#.#.#.
-|..#..##.#.......##.....#...#....
-> tick 100
-tag gen 4 alive 112
-|.#....#....#................#...
-|#.#............#......#....#....
-|.#.......##.....#......#.......#
-|####....#.#.....#......#........
-|.###....#........#..........#...
-|.#........#.....#.#........#..#.
-|..#.#.....#.##.#..##.......#..#.
-|..#.##.....#....#.#.#.......#.##
-|#.#.#.........#.##.#..#......#.#
-|..#...#.......#....#.....#...#..
-|.............##.....#......#...#
-|.......#.#.#.........#.....#.###
-|.......##.#...##...#...#......#.
-|......#...#...##.#.#......##..#.
-|.....#...#...#............#....#
-|.....#.##...#...............#.#.
-> tick 100
-tag gen 5 alive 132
-|.#....##...................###..
-|#.#.......#.....................
-|...#.....##....##.....##.......#
-|...#....#.#.....##..............
-|...#............##..............
-|.#.......#.#....#.##.......###..
-|.##.##....#.#..##.#........##.#.
-|#.#.##.....####.#...#.......#...
-|#.#.#...........##.##.......##.#
-|##.#..........#...###.......#..#
-|.............##.....#.....#..#.#
-|.......#.##..#.#....#.......##.#
-|......###.##..###.#.#.....###...
-|......###.#..#.##.#.......##..##
-|.....#.###...##...........#..###
-|.....#.##...#..............#.#..
-> blur
-tag gen 5 alive 132
-|.#....##...................###..
-|#.#.......#.....................
-|...#.....##....##.....##.......#
-|...#....#.#.....##..............
-|...#............##..............
-|.#.......#.#....#.##.......###..
-|.##.##....#.#..##.#........##.#.
-|#.#.##.....####.#...#.......#...
-|#.#.#...........##.##.......##.#
-|##.#..........#...###.......#..#
-|.............##.....#.....#..#.#
-|.......#.##..#.#....#.......##.#
-|......###.##..###.#.#.....###...
-|......###.#..#.##.#.......##..##
-|.....#.###...##...........#..###
-|.....#.##...#..............#.#..
-> tick 300
-tag gen 5 alive 132
-|.#....##...................###..
-|#.#.......#.....................
-|...#.....##....##.....##.......#
-|...#....#.#.....##..............
-|...#............##..............
-|.#.......#.#....#.##.......###..
-|.##.##....#.#..##.#........##.#.
-|#.#.##.....####.#...#.......#...
-|#.#.#...........##.##.......##.#
-|##.#..........#...###.......#..#
-|.............##.....#.....#..#.#
-|.......#.##..#.#....#.......##.#
-|......###.##..###.#.#.....###...
-|......###.#..#.##.#.......##..##
-|.....#.###...##...........#..###
-|.....#.##...#..............#.#..
-> focus
-tag gen 5 alive 132
-|.#....##...................###..
-|#.#.......#.....................
-|...#.....##....##.....##.......#
-|...#....#.#.....##..............
-|...#............##..............
-|.#.......#.#....#.##.......###..
-|.##.##....#.#..##.#........##.#.
-|#.#.##.....####.#...#.......#...
-|#.#.#...........##.##.......##.#
-|##.#..........#...###.......#..#
-|.............##.....#.....#..#.#
-|.......#.##..#.#....#.......##.#
-|......###.##..###.#.#.....###...
-|......###.#..#.##.#.......##..##
-|.....#.###...##...........#..###
-|.....#.##...#..............#.#..
> tick 200
-tag gen 6 alive 123
-|.#....###..................#.#..
-|###......##.................#...
-|..##......##...###..............
-|..###.....#.....................
-|..#......##....#............#...
-|.#.##.....##......##.......#.#..
-|#.#.##....#...#.#.#.............
-|#.#........####...#.#.........#.
-|..#.##......#.#.##...#.....####.
-|.###.........###.##..#.....##...
-|.............#.#....##.....#.#.#
-|......##.#####..#...##....#..#..
-|...........###............#....#
-|.....#....####..#..#.....#.....#
-|.....#......####..........#..#.#
-|.....#...#...#............##....
+tag gen 3 alive 131
+|.#.........#...#......#.....#...
+|#.#........#....................
+|.#.............###....###.##...#
+|#.......###..#..................
+|..###....##.....................
+|..#.......#.#...###........###..
+|..###.....#.#....##........####.
+|....#......#..#.#...#.........#.
+|.#...#.........##..##..........#
+|.#.#..........#.#...####.....##.
+|......##....###.##...######...##
+|..........#.....##....######..#.
+|........#.#...##.###........#...
+|.......###....#...##.....######.
+|.....##.##...................##.
+|.....###....##.........#....###.
diff --git a/addons/life/life.script b/addons/life/life.script
index fba9cd62..a97fcdb8 100644
--- a/addons/life/life.script
+++ b/addons/life/life.script
@@ -13,8 +13,9 @@ body
dump
key r
# h, Space (resume; a line's ends are trimmed), l. The tick after a key is
-# handed the time of the last tick, from before the paused 300 ms, so the
-# next tick 100 catches up four generations.
+# told the clock's time (1.6 s), so the game goes on a period from there:
+# none at the next frame, two generations in 200 ms (it caught up four
+# when that tick was told the last stepped frame's, 1.24 s).
key h l
tick 100
tick 100
diff --git a/addons/life/life.zig b/addons/life/life.zig
index 5ea9c302..2ef26c56 100644
--- a/addons/life/life.zig
+++ b/addons/life/life.zig
@@ -29,13 +29,8 @@ const Life = extern struct {
pub fn tick(s: *Life, now: u64, flags: addon.Flags) u64 {
if (!flags.focused or s.paused) return s.next.stop();
- // A record's deadline is of another clock's origin.
- if (s.next.at > now + period) s.next.at = 0;
- if (!s.next.due(now)) return s.next.every(now, period);
- s.step();
- // From the step's due time, not now: a tick comes on a frame, late.
- s.next.at = if (now - s.next.at < period) s.next.at + period else now + period;
- return s.next.at;
+ if (s.next.due(now)) s.step();
+ return s.next.every(now, period);
}
pub fn key(s: *Life, k: addon.Key) bool {