Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Lesson3;
- import kareltherobot.*;
- /**
- * Francesco Di Mise
- * This is a program to create a building using many robots creating using separate classes
- * it is possible to create various robots of the same type that serve the same function to carry out similar tasks
- */
- public class Lesson3Activity4 implements Directions{
- /**
- * The main function. Creates the robots (multiples of each in several cases)
- * It also calls the build function, which exists in each sub class but performs different actions depending on the type of robot
- * @param args
- */
- public static void main(String[] args) {
- World.setDelay(15);
- World.setSize(11,11);
- World.setVisible();
- WallBuilder bob = new WallBuilder(1, 2, North, -1);
- WallBuilder bobby = new WallBuilder(1, 10, North, -1);
- WindowBuilder jack = new WindowBuilder(5, 5, North, -1);
- WindowBuilder jackie = new WindowBuilder(5, 8, North, -1);
- RoofBuilder harry = new RoofBuilder(5, 1, North, -1);
- DoorBuilder bill = new DoorBuilder(1, 5, North, -1);
- ChimneyBuilder gus = new ChimneyBuilder(7, 2, North, -1);
- bob.build();
- bobby.build();
- bill.build();
- jack.build();
- jackie.build();
- harry.build();
- gus.build();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement