I'm trying to pick random positions, but also ensure subsequent random positions aren't close to prior positions. In this instance, just adjacent "cells" are removed, but I'd be intrigued how to make this wider, too.
There's probably been similar questions, but I don't even know basic terminology to search for them, apologies!
I can't think how to do this with code other than a layered and abusive exploitation of the wondrous GameplayKit randomisation tools and Swift's elegant array handling, in a jumbled mess.
Is there a way to do this sort of thing that's kind of, well, elegant and accepted/understood and not a complete spaghetti mess?
imagine a board with 8x6 positions available. The first randomly picked position is shown here as (A) and subsequently means adjacent squares are not available...
A subsequent random choice (B) might be like this:
And yet another, and imagine this process going on... at which point I am confused about how to deal with running out of spaces, but that's another problem, for another question...