diff options
Diffstat (limited to 'anim/scenes/sort.zig')
| -rw-r--r-- | anim/scenes/sort.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/anim/scenes/sort.zig b/anim/scenes/sort.zig index 0f14269..6ad41f9 100644 --- a/anim/scenes/sort.zig +++ b/anim/scenes/sort.zig @@ -22,16 +22,16 @@ fn frame(s: *anim.Frame) void { while (rec.next(.over, rec.next(.over, start)) < rec.call("swap", 0).enter) start = rec.next(.over, start); var at = canim.cursor(s, rec, start); // The array is the idea; `i` and `j` are memory, and strike a beat before their tags slide. - at.levels = .{ .cpu = false, .idea = .data, .follow = t.quick, .source_rows = 8 }; + at.levels = .{ .cpu = false, .idea = .data, .follow = t.quick, .source_rows = 10 }; // Its last compare: nothing larger is left of 20. const last = rec.call("swap", 9); const end = rec.next(.over, rec.next(.over, last.exit.?)); at.journey(.over, end); // The context is the instrumented program's: its registers are unmarked. - const split = canim.layout.split.beside; + const split = canim.layout.split.subject; const ctx = canim.context(s, at, .{ .split = split, .quiet = true }); // The lens: the array as cells, and the two indices that walk it. - const cells = canim.array(s, .{ .cursor = at, .box = split.lens, .variable = "a", .indices = &.{ "i", "j" }, .focus = true }); + const cells = canim.array(s, .{ .cursor = at, .stage = ctx.stage, .variable = "a", .indices = &.{ "i", "j" }, .focus = true }); var says: canim.Narrator = .{}; // A swap, start to finish, as one step of sort(): over the call. const swap = struct { @@ -40,8 +40,8 @@ fn frame(s: *anim.Frame) void { } }.step; - const joins = canim.ties(s, .{ .cursor = at }); - canim.establish(s, .{ ctx.clock, ctx.source, ctx.disasm, ctx.registers, ctx.stack, ctx.backtrace, cells, joins }); + const joins = ctx.ties(s); + canim.establish(s, .{ ctx.clock, ctx.registers, ctx.stack, ctx.source, ctx.disasm, cells, joins }); says.line(s, "`i` walks right. Everything left of it is in order,\nand 12 is not yet in its place."); // The compare: both cells framed. It is the swap's anticipation. at.walk(s, .over, rec.next(.over, start)); |
