Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import kareltherobot.*;
- public class Lesson2Activity3 implements Directions {
- public static void main(String[] args){
- UrRobot roomba = new UrRobot(5, 3, North, -1);
- World.setDelay(75);
- World.setVisible();
- World.readWorld("Lesson2World1.kwld");
- for(int index = 0; index < 5; index ++){
- roomba.putBeeper();
- roomba.move();
- roomba.move();
- roomba.putBeeper();
- for(int index2 = 0; index2 < 3; index2++){
- roomba.turnLeft();
- }
- for(int index3 = 0; index3 < 4; index3++){
- roomba.move();
- }
- roomba.putBeeper();
- for(int index4 = 0; index4 < 3; index4++){
- roomba.turnLeft();
- }
- roomba.move();
- roomba.move();
- for(int index5 = 0; index5 < 3; index5++){
- roomba.turnLeft();
- }
- roomba.putBeeper();
- for(int index6 = 0; index6 < 4; index6++){
- roomba.move();
- }
- for(int index7 = 0; index7 < 3; index7++){
- roomba.turnLeft();
- }
- }
- for(int index8 = 0; index8 < 3; index8++){
- roomba.turnLeft();
- }
- roomba.move();
- roomba.turnLeft();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement