|
Sample Code: GraphMultiple.java
package examples;
import becker.robots.*;
public class GraphMultiple extends Object
{
public static void main(String[] args)
{
GraphCity gc = new GraphCity(7, 1, 1, 10);
gc.showThingCounts(true);
GraphBot karel = new GraphBot(gc, 1, 1, Directions.EAST);
GraphBot hal = new GraphBot(gc, 1, 3, Directions.EAST);
GraphBot sue = new GraphBot(gc, 1, 5, Directions.EAST);
CityFrame f = new CityFrame(gc, 12, 9);
sue.makeGraph();
hal.makeGraph();
karel.makeGraph();
}
}
Note: the source code for an applet is slightly different than for an application. Contact: bwbecker@learningwithrobots.com. |