diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 18:06:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 19:01:23 -0300 |
| commit | e63b0624f57472d40af32a006c32cc47d403b822 (patch) | |
| tree | b7295da62acd96bc7aba425720eed95605526693 /anim/src/objects.zig | |
| parent | 318e16181a28725e218121363555580725d6d0d4 (diff) | |
| download | computeranim-e63b0624f57472d40af32a006c32cc47d403b822.tar.gz computeranim-e63b0624f57472d40af32a006c32cc47d403b822.zip | |
canim: what the review found; the band as two panels; list and sort by instruction
The first videos were reviewed frame by frame and the catalogue changed
with them. A lens is a drawing over the program column and its view over
the state column, so the stack keeps six slots, its window on the whole
frame. Operands are whole. list and sort are recorded by instruction
from main (record --from), so their registers strike, links reach nodes
and cells, rows that ran are marked and jumps are drawn. A call's node is
a projection of its return address; pins travel and keep their side; a
mark covers the bytes that changed, at the element's width; a syscall's
result is stored after the kernel returns it and every panel is of one
moment; fast passes are veiled; the clock stands still during a step;
captions get their reading time and a scene's first step comes by four
seconds.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/src/objects.zig')
| -rw-r--r-- | anim/src/objects.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/anim/src/objects.zig b/anim/src/objects.zig index 57e2b11..0c4f48a 100644 --- a/anim/src/objects.zig +++ b/anim/src/objects.zig @@ -122,6 +122,20 @@ pub fn spell(scratch: std.mem.Allocator, t: types.Type) []const u8 { }; } +/// A number as its type says to read it (the `value` classes a type +/// gives): a boolean `true`, a character quoted, else its decimal. +pub fn reading(scratch: std.mem.Allocator, n: i64, t: types.Type) []const u8 { + if (t == .scalar) switch (t.scalar.kind) { + .bool => return if (n != 0) "true" else "false", + .char => { + const c: u8 = @truncate(@as(u64, @bitCast(n))); + return if (std.ascii.isPrint(c) and c != '\'' and c != '\\') std.fmt.allocPrint(scratch, "'{c}'", .{c}) catch "?" else std.fmt.allocPrint(scratch, "'\\x{x:0>2}'", .{c}) catch "?"; + }, + else => {}, + }; + return std.fmt.allocPrint(scratch, "{d}", .{n}) catch "?"; +} + /// A variable as C declares it: `int a[8]`, `node *prev`, `long n`. pub fn declare(scratch: std.mem.Allocator, rec: *const Recording, v: Recording.Variable) []const u8 { const name = rec.name(v.name); |
