From 7e9bf9e6e85c6c6e7a400d4fa0b43b77133ed3cb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 14:48:26 -0300 Subject: canim: animations of recordings, as a debugger's whole context with a lens beside it A package of its own (anim/), on sketchbook's anim module and pardes's syntax. A scene opens a recording, takes a cursor into it, and declares blocks that read the moment the cursor is at: the state column (registers each followed as a pointer and inked by where it points, the stack telescope, the backtrace), the program column (the whole source, the disassembly in address order, and the scene's lens: a node-link list over a hexdump of its heap, array cells, a call tree, a syscall crossing), and ties between them. Motion is a step told as a sentence (the line fires, its effects cascade a level at a time, the mark moves on last), timed by what the step contains; walk, hurry and sprint pace a loop. Five scenes from real recordings of fib, a linked list, a sort and syscalls. First drafts, by the agent's own handover: the frame of the design's second revision, the hexdump lens and the ties; no disassembly annotations, no gallery, scenes not yet reviewed against the mocks. --- anim/tools/sort.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 anim/tools/sort.c (limited to 'anim/tools/sort.c') diff --git a/anim/tools/sort.c b/anim/tools/sort.c new file mode 100644 index 0000000..5816390 --- /dev/null +++ b/anim/tools/sort.c @@ -0,0 +1,22 @@ +int a[8] = {4, 9, 17, 31, 12, 26, 5, 20}; + +void swap(int *x, int *y) { + int t = *x; + *x = *y; + *y = t; +} + +void sort(int n) { + for (int i = 1; i < n; i++) { + int j = i; + while (j > 0 && a[j - 1] > a[j]) { + swap(&a[j - 1], &a[j]); + j--; + } + } +} + +int main(void) { + sort(8); + return 0; +} -- cgit v1.3