From af2d2cfdcdf5976f06fbcc4b1f8507f0b7d4af89 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 12:01:16 -0300 Subject: design: the visual system canim follows, with eight mock frames Lapis page and vellum ink; a role is a form as well as a colour (current, write, read, pointer, allocated, freed, fault, kernel); panels as acme windows; Go Mono for the machine and Go for the narrator; motion as whole frames at 60 fps. design/mock/gen.py redraws the mocks from the tokens. --- design/mock/07-sort-swap.svg | 129 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 design/mock/07-sort-swap.svg (limited to 'design/mock/07-sort-swap.svg') diff --git a/design/mock/07-sort-swap.svg b/design/mock/07-sort-swap.svg new file mode 100644 index 0000000..6e866e5 --- /dev/null +++ b/design/mock/07-sort-swap.svg @@ -0,0 +1,129 @@ + + + +Insertion sort +sort.c:6 +kernel + +memory + +cpu + +source + + + + + + +a +int a[8] + +0 +4 + +1 +9 + +2 +17 + + +3 + +j-1 +31 + + +4 + +j +12 + + +5 + +i +26 + +6 +5 + +7 +20 + +31 > 12 +so they trade places + + + + +31 + + + + +12 + + + + +sort.c +3 +for +( +int +i = +1 +; i < n; i++) { +4 +int +j = i; + +5 +while +(j > +0 +&& a[j-1] > a[j]) { + + +6 +swap(&a[j-1], &a[j]); + +7 +j--; + + + + +locals +of sort() +i +int +5 +j +int + + +4 +n +int +8 +a +int * +7 +f +f +d +3 +a +2 +c +1 +e +2 +0 +where a[0] is +While the one on the left is larger, they trade places, +and j follows the smaller value down. + -- cgit v1.3