Advertisement
Guest User

hey

a guest
Jan 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. function start(){//GO
  2. buildTower();
  3. while(frontIsClear()){
  4. if(frontIsClear()){
  5. buildTower();
  6. moveToTower();
  7. }
  8. }
  9. }
  10. function buildTower(){
  11. if(ballsPresent()){
  12. move();
  13. if(frontIsClear()){
  14. move();
  15. turnLeft();
  16. putBall();
  17. move();
  18. putBall();
  19. move();
  20. putBall();
  21. turnAround();
  22. move();
  23. move();
  24. turnLeft();
  25. }else{
  26. if(frontIsClear()){
  27. turnLeft();
  28. putBall();
  29. move();
  30. putBall();
  31. move();
  32. putBall();
  33. turnAround();
  34. move();
  35. move();
  36. turnLeft();
  37. }
  38. }
  39. }else{
  40. turnLeft();
  41. putBall();
  42. move();
  43. putBall();
  44. move();
  45. putBall();
  46. turnAround();
  47. move();
  48. move();
  49. turnLeft();
  50. }
  51. }
  52. function moveToTower(){
  53. checkWall();
  54. }
  55. function checkWall(){
  56. if(frontIsClear()){
  57. move();
  58. }
  59. if(frontIsClear()){
  60. move();
  61. buildTower();
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement