Sounds like you want something akin to this:
I: X 1; Y 1
1: @MOVE X Y; CV 1 N @
2: Z RAND 3
IF EQ Z 0: X 1; Y 1
IF EQ Z 1: X -1; Y 1
IF EQ Z 2: X -1; Y -1
IF EQ Z 3: X 1; Y -1
Which rotates to a random 45-degree-from-cardinal offset. It would be trivial to limit this to eliminate 180 degree turns.
My observation was that:
The script that I wrote above is more predictable.
The script that you wrote above does not guarantee that the cell will change each time script 1 is called unless you ensure that @SPEED is about 141 and you `@X @X; @Y @Y’ after every step.
Therefore, the script that I wrote above is also less complex than yours. If you truly intend to move 1 cell at a time in a 45 degree offset to a cardinal direction, I think it is the better script.
Yes, it’s longer and more explicit, but I never understood you to be someone who appreciates terse complexity. Perhaps I was mistaken?
Also, can you see how the script is easier to understand than if I had used the general-purpose variables B and T instead of X and Y?
Wouldn’t that be poetic justice?