Advertisement
Guest User

Untitled

a guest
May 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. World.reset();
  2. World.readWorld("testworld.kwld");
  3. World.setVisible(true);
  4. World.setDelay(10);
  5. BetterRobot bob = new BetterRobot(1,1,East,0);
  6. for(int i=1; i<=4;i++){
  7. while(bob.frontIsClear() ){
  8. bob.move();
  9. }
  10. bob.turnRight();
  11. bob.turnRight();
  12. bob.turnRight();
  13. bob.pickAllBeepers();
  14. bob.move();
  15. bob.turnRight();
  16. }
  17. while(bob.frontIsClear() ){
  18. bob.move();
  19. }
  20. bob.putAllBeepers();
  21. bob.turnAround();
  22. while(bob.frontIsClear() ){
  23. bob.move();
  24. }
  25. bob.turnLeft();
  26. while(bob.frontIsClear() ){
  27. bob.move();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement