Re: Find The Way Out Problem, VB.NET 2003 - solution needed(
- From: "James Hahn" <jhahn@xxxxxxxxx>
- Date: Sat, 18 Jul 2009 14:05:37 +1000
You are thinking walls but you really need to think in cells. The maze is an aray of cells where each array element includes codes to indicate which of its four edges are walls and which are not. If you build your maze like this then it is relatively easy to keep track of where the taveller is, which directions are valid for movement and whether or not the current cell has the exit gap. It is also easy to check if the current cell is a dead end. When you get to constructing your non-random maze it will be constructed as an array - in fact the only algorithm I know for a perfect maze (exactly one solution and that solution traverses the whole maze) requires that it be built cell by cell and then wall by wall for each cell.
You would traverse the pushbuttons to build the current state of the maze (although in practice the state could be maintained dynamically with each button press). But for constructing and examinig the maze it needs to be an array of cells.
"Totti" <saliba.toufic.george@xxxxxxxxx> wrote in message news:4dacd4ff-fd3e-4014-a5aa-5c2992b6cbd7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Mike you are right but the user has the right to click and make his
own wall and his own maze so what you suggested even though very
correct and i agree, will be left till the end.
What i need here is a loop that traverses the pushbuttons and checks
their states, and maybe keep the information that they have been
visited.when it comes to a dead end, it will look in the array for
somebody who can be traversable and go through it. till it reaches the
end where the pushbutton state is set to out. in the meanwhile, it
should write out the path somehow, i am thinking of changing the
pushbutton color to red or something
.
- References:
- Find The Way Out Problem, VB.NET 2003 - solution needed(
- From: Totti
- RE: Find The Way Out Problem, VB.NET 2003 - solution needed(
- From: Family Tree Mike
- Re: Find The Way Out Problem, VB.NET 2003 - solution needed(
- From: Totti
- Find The Way Out Problem, VB.NET 2003 - solution needed(
- Prev by Date: VS2k8 SP1 Feature not noticed yet
- Next by Date: Re: Object initialized in a try-catch
- Previous by thread: Re: Find The Way Out Problem, VB.NET 2003 - solution needed(
- Next by thread: SATA drive can't see files
- Index(es):
Relevant Pages
|