Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function start(){
  2. startme();
  3. buildTower();
  4. putBall();
  5. }
  6. //This function make Karel face north is Karel is facing west.
  7. function startme(){
  8. if(facingWest()){
  9. turnRight();
  10. }
  11. if(facingEast()){
  12. turnLeft();
  13. }
  14.  
  15. if(facingSouth()){
  16. turnLeft();
  17. turnLeft();
  18. }
  19. }
  20. //This function makes Karel put the tennis balls up to the top of the "world".
  21.  
  22. function buildTower(){
  23. while(frontIsClear()){
  24. putBall();
  25. move();
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement