# Procedural Maze Generation Basics > Generate fresh playable mazes automatically using a grid list and randomized depth-first carving. Procedural Maze Generation Basics — Generate fresh playable mazes automatically using a grid list and randomized depth-first carving. ## Core approach Represent cells as walls (1) or paths (0), carve randomly to unvisited neighbors, and backtrack with a stack list when stuck. - Start with a small 9×7 odd-sized grid so walls and passages stay crisp. - Use "Run without screen refresh" to carve the entire maze in under 0.1 seconds. - Render the grid using Pen stamps. ## Pro tip & next steps Every generated maze is guaranteed solvable from start to finish! - [All Techniques](/en/techniques/): Browse more English guides in this section. - [Scratch Block Dictionary](/en/dictionary/): Look up any Scratch 3.0 block with examples. Updated: 2026-11-23 Author: [Takamasa Suzuki](https://scratch.gmnavi.jp/about/author/) Japanese Edition: https://scratch.gmnavi.jp/techniques/maze-generation/ [Scratch Daizen (English)](https://scratch.gmnavi.jp/en/)