avatar
Jack Rusher @jackrusher.com

One can generate nice patterns using only XOR, like the 2D pattern on the left: (doseq [x (range w)] (doseq [y (range h)] (when (not (zero? (mod (bit-xor x y) 7))) (draw-mark x y)))) … but it's also possible to add another dimension to carve a 3D shape, like the render on the right.

image image
jul 19, 2025, 7:35 pm • 32 3

Replies

avatar
rob pike @robpike.io

3d munching squares

jul 19, 2025, 10:16 pm • 1 0 • view
avatar
wmblathers.bsky.social @wmblathers.bsky.social

Oh my god. I tried out LOGNOR (bitwise not) and yet again some variant of the Sierpinski triangle pops out (I'm using my own eccentric Common Lisp library here, rather than Clojure). Actually, several operations do. That triangle might be the key to the universe.

Common Lisp code... (with-canvas-to-file (c A tiling, generative pattern with variations of the Sierpinski triangle lying on its side.
jul 19, 2025, 9:19 pm • 7 1 • view
avatar
Vale@ganbara.nai @valerauko.net

animate it for the munching squares

jul 20, 2025, 2:04 am • 1 0 • view