SHARE
TWEET

Untitled

a guest Aug 25th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class KarelProgram extends Karel {
  2.    
  3.     public void run() {
  4.         putInPosition();
  5.         turnLeft();
  6.         putInPosition();
  7.         turnRight();
  8.         makeFlower();
  9.         putInPosition();
  10.         makeFlower();
  11.         turnRight();
  12.         putInPosition();
  13.         turnLeft();
  14.     }
  15.    
  16.     private void makeFlower() {
  17.         putBall();
  18.         turnLeft();
  19.         moveAndPut();
  20.         turnRight();
  21.         moveAndPut();
  22.         turnRight();
  23.         moveAndPut();
  24.         turnLeft();
  25.     }
  26.    
  27.     private void putInPosition() {
  28.         move();
  29.         move();
  30.         move();
  31.     }
  32.    
  33.     private void moveAndPut() {
  34.         move();
  35.         putBall();
  36.     }
  37.    
  38.     private void turnRight() {
  39.         turnLeft();
  40.         turnLeft();
  41.         turnLeft();
  42.     }
  43.    
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top