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