Advertisement
Guest User

brand new pastey

a guest
Jan 19th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. package Activity2;
  2. import kareltherobot.*;
  3. public class Activity2 implements Directions
  4. {
  5.  
  6. public static void main (String[] args) {
  7. World.readWorld("KarelChallenges2.kwld");
  8. World.setVisible();
  9. World.setDelay(25);
  10. Activity1.uberBot huggins = new Activity1.uberBot(1, 9, East, -1);
  11. // AMAZING EMERGENCY EXIT so basically i just have to escape the maze. does not seem hard at all. i think. im gonna regret this.
  12. // so i just have to hug the left wall right. it would overall be faster to hug the left right
  13. // step one is simple. just do a thing, in a place, so i have to do this code elsewhere that will check if front
  14. //is clear and if front is clear than it would check if left is clear and if left is clear it would move left if
  15. // not it moves back. seems very simple. whoops it hugs the right wall but that works too i guess
  16.  
  17. while (!huggins.nextToABeeper())
  18. {
  19. huggins.mazeMan();
  20. }
  21. huggins.dance();
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement