Maze Arrays

random Wang tile layouts

stage Block 2 2-edge 2-corner Twin

Block 4 3-edge 3-corner Blob
label Truchet   -Draw-


Use the pull-down menus to select a tileset, which will display as a random layout on stage. Selecting another tileset from the same menu will update the stage. The top blank menu entry removes all tiles.

Click 'Random' to create a new random layout.
Tick the check box below pull-down menus for alternative random layout methods.

Click 'Sprinkle' to continueously alter tiles. Sprinkle uses the Draw radio button values, which can be changed while sprinkling. Click 'Sprinkle' again to stop (and remove the button hi-lite).

Click 'Invert' to invert all tiles. Edge and corner '0' and '1' values are exchanged.
For order 3 tilesets, values '1' and '2' are exchanged leaving '0' unaffected. This swops high and low ground levels and reverses the flow of directed paths.
To add in Twin alt tiles, invert twice.

Click 'Clear' to clear the stage. Click again to cycle between 0 and 1 (2 order tilesets) or 1 and 2 (3 order tilesets).

Click 'Maze' to generate a 'perfect' maze, using the current 2-edge, 2-corner, Twin or Blob tileset. Tilesets in the upper part of the pull-down menu are best for mazes.
All mazes can be adjusted using the ran/last selector. 'Random' creates many short stubby paths (Prim's algorithm). 'Last' creates long winding paths (recursive backtracker algorithm).


It may be easier to start drawing on a cleared stage.
To draw or delete paths, click to select a cell. The stage border will turn red to indicate 'edit' mode. A cursor will appear over the selected cell. Move the mouse to an adjacent perpendicular (edge tileset) or diagonal (corner tileset) cell and the stage will update. If it does not, you may be drawing using the same 'draw' value as the stage background…

To change the 'draw' value, select one of the radio buttons. Select '0' to remove paths or '1' (or '2') to add paths. Select 'inv' to invert paths. This swops '0' and '1' when using order 2 tilesets but swops '1' and '2' while leaving '0' unaffected with order 3 tilesets. This swops high and low ground levels and reverses the flow of directed paths.
When drawing, you can retrace your path to invert values back again.

To stop drawing, click a cell to leave 'edit' mode. The stage border will turn back to black and the edge or corner cursor will be removed.

Blob tilesets cannot be inverted. Use Clear to toggle 'all on' and 'all off'. When a cell is selected and deselected without moving, the cursor will toggle between edge and corner editing.

With Twin tilesets you need to move 2 cells horizontally or vertically to draw.

Block and Truchet tiles work in the same way, but drawing will cycle the tiles.

Use the 'label' pull-down menu to show cell information.
Select 'Index' to show tile index values. These will update as you draw etc.
Select 'Same', to show all similar tiles on stage. Select and deselect a tile (without drawing) to show every tile of the same index.
Select 'none' to remove all labels.

Use the 'stage' pull-down menu to select different stage sizes. Select 'window', to fill the browser window.

See [Wang] for tileset information, [Tiles] for complete galleries and Block tilesets here.