From dc7f7407e08f54e4a2a3c1d1723b2a7d6959532d Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Wed, 14 Oct 2026 09:09:21 +0330 Subject: docs: archive the frozen stage code as one compressed tarball docs/history kept six stages with a full copy of the project under code/, 3.8 mb of sources duplicated from stage to stage and already superseded. store them as docs/history/code-snapshots.tar.gz, 0.66 mb, and extract one in place to read it. every stage's notes.md stays browsable, and the index says where the code went and how to get it back. the top-level README points at the archive too. its other two links into docs/history, 21-micro and 35-bench, were notes that were never kept and do not resolve; the index now records that. --- docs/history/15-o3/code/examples/mandel.zc | 36 ------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 docs/history/15-o3/code/examples/mandel.zc (limited to 'docs/history/15-o3/code/examples/mandel.zc') diff --git a/docs/history/15-o3/code/examples/mandel.zc b/docs/history/15-o3/code/examples/mandel.zc deleted file mode 100644 index 5810397..0000000 --- a/docs/history/15-o3/code/examples/mandel.zc +++ /dev/null @@ -1,36 +0,0 @@ -// the mandelbrot set in 16.16 fixed point. the cpu has no fixed-point -// multiply, so one gets wired in: a 32x32 -> 64 bit multiply, keeping the -// middle 32 bits. the jit inlines it as two native multiplies and a shift. -enhance fmul(a, b) micro - "r2 = mul a b; r3 = mulhs a b" - "; r3 = shl r3 16; r2 = shr r2 16; a = or r3 r2"; - -const ONE = 65536, W = 72, H = 28, MAXIT = 40; -let shades = " .,:;-=+*%#@"; - -int escape(int cx, int cy) { - int x = 0, y = 0, i = 0; - while (i < MAXIT) { - int xx = fmul(x, x), yy = fmul(y, y); - if (xx + yy > 4 * ONE) return i; - y = 2 * fmul(x, y) + cy; - x = xx - yy + cx; - i++; - } - return MAXIT; -} -fn main() -{ - int row = 0; - while (row < H) { - int col = 0, cy = (row * 2400 / (H - 1) - 1200) * ONE / 1000; - while (col < W) { - int cx = (col * 3200 / (W - 1) - 2200) * ONE / 1000, it = escape(cx, cy); - putc(it == MAXIT ? '@' : shades[it * 11 / MAXIT]); - col++; - } - putc(10); - row++; - } - return 0; -} -- cgit v1.2.3