ScratchData LogoScratchData
Back to squarepoint's profile

Random maze generator

SQsquarepoint•Created July 24, 2022
Random maze generator
15
10
120 views
View on Scratch

Instructions

This 150 block script generates random mazes of whatever size, and stores them in a list so that you can make games and raytracers out of it. (tho no one makes a ratyracer that was my idea!!! lemme finish mine first!!!) HOW TO USE: Mess with the sliders and press space to generate a new maze. All maze have no enclosed areas: it is guaranteed you can go from whatever point A to whatever point B! No impossible mazes. If you want to use this in your projects, backpack the sprite called "generator" Don't tell me this is a-MAZE-ing. That's my pun and no one else can use it

Description

Inspired by this: https://scratch.mit.edu/projects/461725168/ HOW IT WORKS: This uses recursive backtracking. Basically it draws a random twisty line until it hits a point where it cant move anymore (dead end) then it moves back a few steps following the same line until it finds another spot it can make a junction, to draw another line etc until the whole grid is full. Also, if one of the mazes looks like a QR code, scan it. It's randomly generated after all, what could happen?

Project Details

Project ID716633202
CreatedJuly 24, 2022
Last ModifiedMarch 15, 2023
SharedJuly 24, 2022
Visibilityvisible
CommentsAllowed