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

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




PostPosted: Sat May 17, 2008 10:41 am   Post subject: maze help

i want to know that how do you draw random lines in the maze using randint function .....i know a way where you have to use draw.Line function everytime but i dont want to do it beocause its going to be too big

so plzzzzzzzzzzzz help me out ..
thanks ....
Sponsor
Sponsor
Sponsor
sponsor
Zampano




PostPosted: Sat May 17, 2008 11:29 am   Post subject: Re: maze help

First, randint is not a function, it is a procedure; int Rand.Int is a function, and, according to the powers that be, you should be using it.
Now about your problem. How about you set up your array of 100 * 100 as entirely walls. Randomly then, you may draw you path to the exit in a random direction, calling the same function that is draw your path multiple times. You can branch off randomly from you main path as well, but you must make sure that the branches must terminate, and that they do not interfere with the main path, which you know from the start to lead to the exit.

So how about this:
A) You draw the path through your array from beginning to end with as many complications as possible.
B) You create branches from this main path to cause distraction for the user and fill up the rest of the space.

Keep in mind that between each consecutive two nodes of the array is an assumed wall so you don't have to worry about creating space in two consecutive nodes.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: