Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class KarelProgram extends Karel {
- public void run() {
- putInPosition();
- turnLeft();
- putInPosition();
- turnRight();
- makeFlower();
- putInPosition();
- makeFlower();
- turnRight();
- putInPosition();
- turnLeft();
- }
- private void makeFlower() {
- putBall();
- turnLeft();
- moveAndPut();
- turnRight();
- moveAndPut();
- turnRight();
- moveAndPut();
- turnLeft();
- }
- private void putInPosition() {
- move();
- move();
- move();
- }
- private void moveAndPut() {
- move();
- putBall();
- }
- private void turnRight() {
- turnLeft();
- turnLeft();
- turnLeft();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement