I was inspired by the recent chessboard patterns numberphile video and worked on a visualiser so I can explore different patterns. It runs in the browser too! You can see the latest version of it here -
https://tcc.itch.io/red-black-knights
It's written in rust and compiled to WASM, i spent quite a few rounds optimising the simulation side of things, i hope it runs well on everyone's hardware. On mine it is near realtime unless i zoom out too far
Here's a screenshot of the red/black knights configuration
You can move around with WASD or click & drag and zoom with the scroll wheel. It should work on mobile too
I'm not a UX person so the UI is a little clunky, but i'll try to summarise the features in the sidebar:
- view: centering back to the middle of the simulation, PNG export, position/zoom indicators
- library: presets, saving of config to the presets dropdown, ability to export/import base64 encoded strings of the simulation (so you can share configurations between people)
- colouring: i experimented with some different colourings of the simulation (e.g. heatmaps for how often the pixel had to "skip"), but nothing looked great
- random attacks: here you can generate random piece configurations to simulate, i find that having the pieces -> summary view open at the same time as clicking "generate random attacks" is a good way to understand what is happening here
- random pieces: a place where you can simulate random preset pieces, or lock in a specific preset and a random additional piece, etc
- mutate: i was experimenting with easy ways to mutate the existing pieces to see what effect it has on the image
- pieces: maybe the most cluttered part of the UI, "summary" shows the currently simulated pieces, "edit roster" is a section you can add and remove pieces, in "advanced" you can edit individual piece configurations (click on the piece in the summary section to edit them in this advanced view)
Anyway, I thought it was cool and maybe some people here think so as well! I would be very happy to talk more about this or implement any features people would like to see.
Thanks,
Tom
P.S here are some lovely patterns i've stumbled across (and their share codes), i don't know why but i have absolutely loved playing around with this:
I love the shape of this one, and look at the tiny group of 7 cells the blue piece has managed to find for itself in the bottom right quadrant!
rbk:1:eyJ2ZXJzaW9uIjoxLCJnYW1lIjp7ImFybWllcyI6W3sibmFtZSI6InplYnJhXzAiLCJjb2xvciI6eyJyIjowLjI1LCJnIjowLjYsImIiOjAuNzUsImEiOjEuMH0sInZhbGlkX21vdmVzIjpbWy0zLC0yXSxbLTMsMl0sWy0yLC0zXSxbLTIsM10sWzIsLTNdLFsyLDNdLFszLC0yXSxbMywyXV0sImJsb2NrZWRfYnkiOlsxXSwiZW5hYmxlZCI6dHJ1ZX0seyJuYW1lIjoiemVicmFfMSIsImNvbG9yIjp7InIiOjAuODUsImciOjAuMzUsImIiOjAuMywiYSI6MS4wfSwidmFsaWRfbW92ZXMiOltbLTMsLTJdLFstMywyXSxbLTIsLTNdLFstMiwzXSxbMiwtM10sWzIsM10sWzMsLTJdLFszLDJdXSwiYmxvY2tlZF9ieSI6WzBdLCJlbmFibGVkIjp0cnVlfV0sInR1cm5fb3JkZXIiOlswLDFdfSwiY2FtZXJhIjp7IngiOjU3OC41OTg3LCJ5IjotMTMuNDEyMDQ1LCJ6b29tIjoxMC4wMTkzNjV9LCJ0YXJnZXRfaW5kZXgiOjYwMTMxOCwiYm9hcmRfY29sb3VyX21vZGUiOiJBcm15In0=

On the left, in the sidebar, i was playing with the 2 knights version and made each of the pieces a diamond shape just through experimenting, and this appeared! Absolutely stunning right??? The chaotic centre followed by the sort of asymmetry blockyness and then the diagonal groupings as you zoom further out, like a strange ying-yang. So interesting, i think i actually gasped when this appeared. And there is absolutely no indication that this pattern will appear while you change the attack squares on the pieces, like there's no way to "build up" to this pattern, it either is there or it's not, and it'll reveal itself if you find the right piece configuration, does that make any sense?
rbk:1:eyJ2ZXJzaW9uIjoxLCJnYW1lIjp7ImFybWllcyI6W3sibmFtZSI6ImtuaWdodF8wIiwiY29sb3IiOnsiciI6MC4xNSwiZyI6MC4xNSwiYiI6MC4yLCJhIjoxLjB9LCJ2YWxpZF9tb3ZlcyI6W1stMywwXSxbLTIsLTFdLFstMiwxXSxbLTEsLTJdLFstMSwyXSxbMCwtM10sWzAsM10sWzEsLTJdLFsxLDJdLFsyLC0xXSxbMiwxXSxbMywwXV0sImJsb2NrZWRfYnkiOlsxXSwiZW5hYmxlZCI6dHJ1ZX0seyJuYW1lIjoia25pZ2h0XzEiLCJjb2xvciI6eyJyIjowLjg1LCJnIjowLjEyLCJiIjowLjEyLCJhIjoxLjB9LCJ2YWxpZF9tb3ZlcyI6W1stMywwXSxbLTIsLTFdLFstMiwxXSxbLTEsLTJdLFstMSw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