Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Carlos Garcoa
- Lesson 4 Activity 4
- Road Worker
- */
- package Lesson4;
- import kareltherobot.World;
- public class Activity4 extends EsperBot {
- public Activity4(int street, int avenue, Direction direction, int beeperCount) {
- super(street, avenue, direction, beeperCount);
- }
- public static void main(String[] args) {
- World.setDelay(50);
- World.setVisible();
- World.setSize(10, 10);
- World.showSpeedControl(true);
- World.readWorld("Lesson4World3.kwld");
- Activity4 zgod = new Activity4(3, 1, North, -1);
- zgod.fixRoad();
- }
- /**
- * Fills the potholes
- * @return void
- * */
- public void fixRoad() {
- for (int i = 0; i < 10; i++) {
- if (onPothole()) {
- fillPothole();
- walk();
- }else{
- walk();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement