Jump to content

Recursive backtracker, Simple maze generator [Tutorial]


k2p8

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...