technologiclee

http://stanfordkarel.com/lessons.html#/english/unit8/lesson5

Aug 27th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. //http://stanfordkarel.com/lessons.html#/english/unit8/lesson5
  2.  
  3. //Make Karel fill the world
  4. //with beepers
  5. function main() {
  6. //your code here
  7. putBeeperLine();
  8. turnLeft();
  9. move();
  10. turnLeft();
  11. putBeeperLine();
  12. turnRight();
  13. move();
  14. turnRight();
  15. putBeeperLine();
  16. turnLeft();
  17. move();
  18. turnLeft();
  19. putBeeperLine();
  20. turnRight();
  21. move();
  22. turnRight();
  23. putBeeperLine();
  24. turnLeft();
  25. move();
  26. turnLeft();
  27. putBeeperLine();
  28. turnRight();
  29. move();
  30. turnRight();
  31. putBeeperLine();
  32. turnLeft();
  33. move();
  34. turnLeft();
  35. putBeeperLine();
  36. turnRight();
  37. turnRight();
  38. move();
  39. move();
  40. move();
  41. move();
  42. move();
  43. move();
  44. move();
  45.  
  46. }
  47.  
  48. function putBeeperLine(){
  49. putBeeper();
  50. while(frontIsClear()) {
  51. move();
  52. putBeeper();
  53. }
  54. }
Add Comment
Please, Sign In to add comment