maze.

Generative maze pattern.


The center of the canvas is split into a grid of cells and decides randomly for each cell whether to draw: a left or right facing diagonal line, a horizontal line at the top edge of the cell, or a vertical line at the right edge of the cell. A square is then drawn around the center to frame the result.