N
newbie
I have the following Java problem to solve and don't know where to
start. Any help I can get would be appreciated.
I have to program robots with varying behaviors. The robots try to
escape a maze that is 9x9 where the * represents a wall and the 0
represents the starting position.
A robot has a position and a method void move(Maze m) the modifies the
position. Provide a common superclass Robot whose move nethod does
nothing. Provide subclasses RandomRobot and RightHandRuleRobot. Each of
these robots has a different strategy for escaping. The RandomRobot
simply make random moves. The RighrhandRuleRobot moves around the maze
so that its right hand always touches a wall. (A RightHandRuleRobot can
start off by going in any fixed direction until it reaches a wall and
turns into the right-hand-rule mode.)
The program will be tested by redirecting a maze file to its standard
input. A maze file is a text file that contains a 9X9 maze and the
initial robot position. For a given maze file, determine if either of
your robots can escape the maze in 200 steps or not.
Hint given: You should add a field to your RightHandRuleRobot
representing the orientation. Your RightHandRuleRobot may come back to
the same position with a different orientation.
start. Any help I can get would be appreciated.
I have to program robots with varying behaviors. The robots try to
escape a maze that is 9x9 where the * represents a wall and the 0
represents the starting position.
A robot has a position and a method void move(Maze m) the modifies the
position. Provide a common superclass Robot whose move nethod does
nothing. Provide subclasses RandomRobot and RightHandRuleRobot. Each of
these robots has a different strategy for escaping. The RandomRobot
simply make random moves. The RighrhandRuleRobot moves around the maze
so that its right hand always touches a wall. (A RightHandRuleRobot can
start off by going in any fixed direction until it reaches a wall and
turns into the right-hand-rule mode.)
The program will be tested by redirecting a maze file to its standard
input. A maze file is a text file that contains a 9X9 maze and the
initial robot position. For a given maze file, determine if either of
your robots can escape the maze in 200 steps or not.
Hint given: You should add a field to your RightHandRuleRobot
representing the orientation. Your RightHandRuleRobot may come back to
the same position with a different orientation.