(HW) Using array for a maze to get an object through to winning area

So I am trying to complete an assignment where we must move an object through a maze of 0's and 1's where the 0 is open to movement, 1's are blocked blocks, and 2 is the goal.

I do not know how to go from here to call the values in my maze and move the object through the maze. Basically I want to learn how to use the elements in my array to allow my object to move from the bottom left corner to the top right corner all the while printing out that it has moved to this location and once it hits the 2 it gives the response "Congratulations!"

I unfortunately have no idea how to access my values and use them to guide the object. (Which is another problem I have no clue how to do)

If someone could help me understand arrays, how to access them, and how to move an object through the 2D maze that would be great!

1
2
3
4
5
6
7
8
9
10
11
12
  int solveMaze(int[4][4]){

    int maze[4][4] =
    {
    { 1, 1, 0, 2},
    { 0, 0, 0, 1},
    { 0, 1, 0, 1},
    { 0, 0, 0, 1}
    };


}
Topic archived. No new replies allowed.