Menu

#25 Circular maze

open
nobody
GUI (12)
1
2015-05-06
2011-02-25
tinco
No

Add a circle-shaped maze. A maze layout consisting of concentric rings seems to be popular in physical labyrinths.

Discussion

  • tinco

    tinco - 2011-02-25

    We could use a plain square cell grid for this, but automatically center the leave point and mask out the center cell(s).
    When using a user-defined mask, we would need to use a circular projection of the cell coordinates onto the mask image.

     
  • tinco

    tinco - 2015-05-06

    Doable but gnarly in the details...
    We can have a visible grid of C concentric circles of warped-rectangle tiles; C=min(width,height)/2. Each circle is a fixed amount bigger (in diameter) than the one it encloses. Going out from the center, each tile will connect to either one or two tiles in the next circle; going inward, it only connects to one. The split into two tiles happens when tiles would otherwise grow too wide; the Nth circle will have half as many tiles as the 2Nth circle. The number of tiles on any circle is 4(2**M), the innermost being a circle quartered into 4 tiles.

    To map this to a rectangular cell grid, we divide the cell grid into 8 triangular octants. In an octant, starting at the center point, we group cells as follows, where "D-C" is a double-cell tile and "S" a single-cell tile:

    1. D-C
    2. S D-C
    3. D-C D-C
    4. S S S D-C
    5. S S D-C D-C
    6. S D-C D-C D-C
    7. D-C D-C D-C D-C
    8. S S S S S S S D-C

    We see how the cells become too wide and subdivide into halves going from row (1) to (2), (3) to (4), and (7) to (8); generally, from (2**N)-1 to 2**N. Outward from a D-D, i.e. to the next numbered row, we only allow a path from C to D, or from D or C to any S. This means the tiles on a (2**N)-1 are effectively pentagons: they connect to one tile inward, two tiles outward, and two on the same circle.

     

Log in to post a comment.