This example illustrates a method to generate a random closed track in a specified grid (here 12x10 grid cells). Move the mouse to the upper edge of the screen to show the Seed and Complexity sliders, which are used by the pseudo-random number generator (PRNG) to generate the track.. It works by first adding a square (closed track) to the grid, and then iteratively attempt to add pseudo-random detours. All code and art by me (@kriblo).