From 3571b3e8bfb54d6f98ad3bc1f89147275716e5fc Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 08:04:49 -0300 Subject: examples/live: the storyboard as a script, two minutes typed through the editor test/story.script plays the survey's storyboard (reports/demo1.md, the screen and the storyboard) through the editor and asserts State at each beat: a tone typed (`out` 8 instructions, heard on the stream); 220 dragged with the pointer to 330 (245 on the way); a gradient (`color` 10, ending in hsv); `beat`, `kick` and `thump` opened above, `out = thump`, the colour's brightness times `0.5 + kick` (both tapes now hold the kick's exp: the picture pulses because it says kick); the last `)` deleted (the problem at its byte, 162, the tape unchanged) and typed back; inside thump's `sin(...)` (`f*`, `;`, `mi(`), Alt-o hears and sees the call alone (17 instructions ending in sin) and Alt-i its argument (16), Escape the program again; `root` with `seq`, `bass`, `out = bass + thump`, `r` and the ring (`out` 35, `color` 31). Then the session played back, paused, sought to the tone and the kick (each the live moment, leaf by leaf), stepped back 30 frames (0.9 s, the gradient), live again at the kick with the beat made a third faster (`f2`, `;`, `r3`), and the first session sought to its end as it was: nothing overwritten. Each beat's screenshot lands in .zig-cache/story/, named by it; the test step plays it with test/live.script. The storyboard's programs use the square units (`x / 4`, `y / 2 + 0.5` for a gradient over the window). zig build test: 86 of 86 steps. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- examples/live/build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/live/build.zig') diff --git a/examples/live/build.zig b/examples/live/build.zig index a07fe7d..cd686c0 100644 --- a/examples/live/build.zig +++ b/examples/live/build.zig @@ -49,7 +49,7 @@ pub fn build(b: *std.Build) void { app.module.linkLibrary(grammar); app.module.addAnonymousImport("highlights.scm", .{ .root_source_file = b.path("queries/highlights.scm") }); app.module.addAnonymousImport("indents.scm", .{ .root_source_file = b.path("queries/indents.scm") }); - const steps = app.addSteps(.{ .scripts = &.{b.path("test/live.script")}, .tests = &.{b.path("test/grammar.zig")} }); + const steps = app.addSteps(.{ .scripts = &.{ b.path("test/live.script"), b.path("test/story.script") }, .tests = &.{b.path("test/grammar.zig")} }); const lang_test = b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = b.path("src/Lang.zig"), .target = target, .optimize = optimize }) }); steps.test_step.dependOn(&b.addRunArtifact(lang_test).step); -- cgit v1.3