Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import kareltherobot.Directions;
  2. import kareltherobot.Robot;
  3. import kareltherobot.World;
  4.  
  5.  
  6.  
  7. public class ETDiamond implements Directions
  8. {
  9.  
  10. static Robot bobbie = new Robot (2,6, North, infinity);
  11.  
  12. private static void turnRight()
  13. {
  14. bobbie.turnLeft();
  15. bobbie.turnLeft();
  16. bobbie.turnLeft();
  17. }
  18.  
  19. private static void diagonal()
  20. {
  21. for (int b=0; b<4; b++)
  22. {
  23. bobbie.turnLeft()
  24. ; bobbie.move();
  25. turnRight();
  26. bobbie.move();
  27. bobbie.putBeeper();
  28.  
  29. }
  30.  
  31. }
  32.  
  33. public static void main(String[] args)
  34. {
  35. World.setVisible(true);
  36. World.setDelay(0);
  37. for(int i=0; i< 5; i++)
  38. {
  39. diagonal();
  40. turnRight();
  41. }
  42. }
  43.  
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement