An Introduction to RobotWorld
Robots are a set of Java classes designed to help students learn
to program.
We will look at using Robots and moving them around.
Here are the handouts about robots.
There is also an online tutorial.
Here are the main points:
- A programmer writes the Java Program (the source file), e.g. MoveBeeper.java.
This is compiled to generate the byte code (class file), e.g. MoveBeeper.class.
The class file is the run (executed) using the java command.
- The programming process is to create (edit) a file (using notepad),
compile the file and then run the file.
- To create an object from a class definition; use
new, e.g.
new Robot();
However you need to give it a name,
Robot jill = new Robot();
Getting jill to execute a method:
jill.move();
- The two main class in RobotWorld are Worlds and Robots.
The World has methods to add Robots, Beepers and Walls.
The Robot has methods to move, turn, pick up and drop beepers
Here are the notes.
There were some questions.