C++ assignment

I have been given a programming task for my Advanced C++ progging assignment can anybody help me or point me in the right direction.

maze is a guessing game that involves the player to work their way from an entry point to an exit by guessing the direction they should head in at any time. the play occurs in a 10X10 grid and at each point in the grid the player is able to choose to go either left or right. A player looses if they choose a path which is closed (note in the maze the value of that path is -1). A player wins if the path that leads to a 0 value (Indicating that there are no further paths to choose). In order to avoid cheating by just looking at the text file moving left (or right) will not move the player physically onto the next left point on the grid but they will move logically using a left point (or right pointer). There are many incorrect solutions to they maze and only one correct one.


I really dont know where to begin or what exactly has been asked :s any help will be awesome
Matrices are gonna be your best friend in this case. A matrix to hold all the values, which I'm guessing the teacher is trying to teach you weight of going from one position to another using nodes, which is another subject entirely. To start your matrix try a multi-dimensional integer array (simulating the matrix that we know in math) that holds your values of the 'wrong' and 'right' paths. Make sure you also design your whitespace accordingly so you know the correct solution.

1
2
3
4
5
6
7
8
9
10
11
// This is just an example of what it may look like.
int mazeMatrix [10][10] = { -1, -1,  -1, -1, -1,  -1, -1, -1,-1, -1,
                             1, -1, -1, -1, -1, -1, -1, -1, -1, -1,   
                             1,  1,  1,  1,  1,  1,  1,  1,  1,  0,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1,
                            -1, -1, -1, -1, -1, -1, -1, -1,-1, -1 };


Even though the spacing's a little off because of the layout of this forum you get the idea to take whitespace to your advantage to develop your maze. You can see the clear pat from your starting point to the end point at 0. Of course, you can use any whole number you wish unless directed by your instructor otherwise. Hope this helped.
Last edited on
ahh i see, that makes it alot clearer... damn i hate university instructions.

il be sure to add you as a reference in my end evaluation

thanks
Topic archived. No new replies allowed.