Why, hello there! I have a problem you see, I need to use a recursive solution to solve a maze (you've all done that, right? ). Anyway, the problem I have is the return statement. Here is an example
I have to return an arrayList of rooms that have the solution, I declared,
I have to return an arrayList with rows and columns. I made an arrayList called Roomsready, that will add the current rooms, and then call the method again to do it again, and thus keep adding the rooms up to the solution. Thus, with that code, if the NorthWall is open, I am suppose to move to the NorthWall adjacent room, and then check if their a soulution, if their are any open walls their. If not, return to the previous room and check for another wall. South, West, etc. ...Anyone?
Oh, this is my error message:
The arraylist is defined as:
I want to return that arraylist. [ November 08, 2002: Message edited by: Mario Martinez ]
Joined: Jun 18, 2002
I believe you need "import java.util.*; " at the top. Is that the way it is?
Joined: Oct 10, 2002
Originally posted by Ken Cobbs: I believe you need "import java.util.*; " at the top. Is that the way it is?
I have that though. Take a look this though!
solve is the method that will return an arraylist of room addresses, which will be used by another method to draw the solution. [ November 08, 2002: Message edited by: Mario Martinez ]