Trapped Knight
I saw an interesting Numberphile video recently which made me think - how can I visualise these patterns in cool, new ways? I fired up Claude Code and had a crack at it. I prompted with the fact we’d be making a demoscene-style project in C, GPU-accelerated, and using the trapped knight walk. He initially didn’t understand, thinking I wanted a far less interesting and far more geometric pattern than what the knight walk generates, but with some careful steering and guidance I got him to generate some of the patterns of the various types of pieces from the numberphile extended video.
I then thought to myself “does this extend to 3D? If so, how do I visualise that?” - I asked Claude, he was unhelpful. “You can’t! it will just become a giant hairball”. He was right on the basis of how the constraints currently existed - but I’m not interested in the path the knight walks - I’m interested in the patterns that are generated. So after some careful thought, I came up with the idea of generating each “shell” of the end-state of the knights (when placed competitively) as a frame in an animation. The shell appears to “grow” as the animation plays out, and you can see parts of the pattern revealing itself as it goes.
The result looks absolutely astonishing. I’ve published the repo on GitHub, I’ll also add other random stuff to that same repo in due course whenever I get the urge to do some algorithmic art. But this was a really, really cool project and I had a lot of fun with it. Here’s one of the screenshots I captured of the 3D version of the pattern:




