This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes trying to move a robot??????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "trying to move a robot???????" Watch "trying to move a robot???????" New topic
Author

trying to move a robot???????

Bob Holland
Greenhorn

Joined: Dec 15, 2004
Posts: 7
argh!!! i jus dont have a clue as to what the heck im meant to be doing.

hears the deal, im meant to place another robot onto the maze thats allready there, and then guide him to the center. but i jus dont know where to start, heres what i was given:

public class MazeRunner{

/**
* Constructor for objects of class MazeRunner
*/
public MazeRunner(RobotWorld world){
//create a new robot and add to the world
Robot marvin = new Robot(1,1,1);
world.addItem(marvin);

//add code here to get robot to meet the robot at the centre of the maze
//by using loops and the methods provided by the robot class

//for example
marvin.move();
System.out.println(marvin);


}//end constructor

}//end class


AND


public class MazeLauncher {

/**
* Application entry point, use to test main method
*/
public static void main(String[] args) {
//DO NOT EDIT THIS CLASS, just use to test main method
RobotWorld world = RobotWorld.getDefaultRobotWorld();
world.resizeWorld(20, 15, 33);
world.clearWorld();
Maze m = new Maze(world);

//pause
System.out.println("Press enter to let your robot find its way to the other robot in the centre");
UserInput.readString();

MazeRunner mr = new MazeRunner(world);

//pause
System.out.println("Press enter to finish");
UserInput.readString();

System.exit(0);

}//end main
}//end class



now im not at all asking anyone to complete this for me, i just would like to understand how im meant to place the robot, and get him to move???


please help me, this is really getting to me BoB
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673

The comments to your supplied code show you where to start. You should have a class called Robot, but you didn't post that, if it doesn't exist you will need to create one. Also your code mentioned a class called Maze, this hasn't been posted so you may need to write this class as well.
[ January 25, 2005: Message edited by: Nigel Browne ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to move a robot???????
 
Similar Threads
What does this compile error mean?
? about System.out.read()
Maze Solving
help
a very elusive bug