• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a maze recursively  RSS feed

 
Jimmy Howard
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is definitely a question I think I should be fairly close to cracking... but I seem to be creating (1) some areas with walls on four sides or inaccessible areas, and (2) areas that aren't split completely (i.e. wider and higher than 1).

Any and all help is greatly appreciated!!

The full code is as follows with annotations:

 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please write down on paper what the code should do. If you then refine what you are doing, it will turn into pseudo‑code, which can easily be converted to code. Working out such an algorithm from code can be very difficult. You need to work from algorithm to code.
 
Jimmy Howard
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You were 100% correct, went back and through each step individually and it now works! Thanks!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done
Do tell us what the correction was.
 
Jimmy Howard
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jimmy Howard
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently I'm looking to figure out how to utilize this in a separate class in order to solve the maze, but I'm going to give the pseudo-code a couple hours of work before maybe posting it. You guys have been amazingly helpful, I definitely just want to make sure I'm learning instead of making the same mistakes over and over.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!