This is an example program that chooses a random start location in a maze that is not off the screen or buried in a wall. Two different implementations of the spiraling algorithm are used... To see the algorithm work, edit the custom block to uncheck "Run without screen refresh".
Code help for a maze game