TedsAttic

Gotchu Bro

Feb 9th, 2022
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. public class KarelProgram extends Karel
  2. {
  3. public void run()
  4. {
  5. putInPosition();
  6. makeFlower();
  7. putInPosition();
  8. makeFlower();
  9. putInPosition();
  10. CodeHSFunctionProperlyChallenge();
  11. putInPosition();
  12. CodeHSFunctionProperlyChallenge();
  13. putInPosition();
  14. CodeHSFunctionProperlyChallenge();
  15. putInPosition();
  16. CodeHSFunctionProperlyChallenge();
  17. putInPosition();
  18. CodeHSFunctionProperlyChallenge();
  19.  
  20.  
  21. }
  22.  
  23. private void putInPosition()
  24. {
  25. move();
  26. move();
  27. move();
  28. turnLeft();
  29. move();
  30. move();
  31. move();
  32. turnRight();
  33. }
  34.  
  35. private void makeFlower()
  36. {
  37. putBall();
  38. move();
  39. putBall();
  40. turnLeft();
  41. move();
  42. putBall();
  43. turnLeft();
  44. move();
  45. putBall();
  46. turnLeft();
  47. move();
  48. turnLeft();
  49. move();
  50. turnRight();
  51. move();
  52. move();
  53. move();
  54. turnLeft();
  55.  
  56. }
  57.  
  58. private void CodeHSFunctionProperlyChallenge()
  59. {
  60. turnRight();
  61. move();
  62. move();
  63. move();
  64. turnRight();
  65. move();
  66. move();
  67. move();
  68. turnLeft();
  69. turnLeft();
  70. }
  71.  
  72. private void turnRight()
  73. {
  74. turnLeft();
  75. turnLeft();
  76. turnLeft();
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment