Jump to content
k2p8

Recursive backtracker, Simple maze generator [Tutorial]

Recommended Posts

Hi folks ! :D

A tutorial about recursive backtracker in vex to create mazes. The idea is simple : 

 

You get your adjacent neighbours and check if they are not visited, if not, you randomly choose one and move to it.

If no valid neighbours, you backtrack the stack of your previous positions and check if there is a valid neighbour until you find one.

If the stack is empty no valid cells are left so the maze is done.

 

maze.jpg

recursive_backtracking_001.hiplc

Edited by k2p8
  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×