Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 maze game help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TRESSPASS




PostPosted: Sat Apr 02, 2005 9:14 pm   Post subject: maze game help

I need to do an assignment for my class that will create a random maze every time the program is run. The maze must have an entrance and exit just like a regualr maze.
Sponsor
Sponsor
Sponsor
sponsor
Drakain Zeil




PostPosted: Sat Apr 02, 2005 9:59 pm   Post subject: (No subject)

Let's see... you can make random mazes in a few ways... one, draw a random path untill you reach one point (you can make probability and random at once, depending on the result you get a direction).

Another is to develop a maping grid of several numbers, each number is a differnt "block" so lets say 1 is an opening left, 2 is up, 3 is down... 5 can be left and right, etc etc. Then just keep generating randomly until you can get a path to the end (use of some clever IF statements).

Other then that I can't think of anything the pre-made mazes.
TRESSPASS




PostPosted: Sat Apr 02, 2005 10:33 pm   Post subject: (No subject)

the way my teacher told me how was to draw random lines, then use a draw fill drawfill command to know when the maze is complete, im not sure how to do it that way, if someone can write some code to help me out with this project I'll greatly appreciate it.
Drakain Zeil




PostPosted: Sun Apr 03, 2005 9:00 am   Post subject: (No subject)

You could use whatdotcolour on the enterance/exit, after filling on a pixel that is one offset from either side.
rose1997




PostPosted: Tue May 26, 2009 4:47 pm   Post subject: RE:maze game help

how to make a maping grid????
can be very specific
A.J




PostPosted: Tue May 26, 2009 6:12 pm   Post subject: RE:maze game help

Well, one way of creating random mazes is to fill up a 2D array (that will store your maze) with either walls or empty 'spaces' (or 'not walls', if you will). Then, representing this 2D array graphically is just a matter of drawing colored in squares for the walls and blank squares for the empty 'spaces'. If you want to get real fancy, you could use a pathfinding algorithm (e.g DFS/BFS/A*) to graphically represent the shortest path from the entrance to the exit.

I may have misunderstood your question, so I hope this helps.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: