Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.67 KB | None | 0 0
  1. /*
  2. F1 = moveForward();
  3. F2 = turnLeft();
  4. F3 = turnAround();
  5. F4 = turnRight();
  6. F5 = pickBeeper();
  7. F6 = dropBeeper();
  8. */
  9.  
  10. /*--------------------------------- 1.1.1 ----------------------------------------------------*/
  11.  
  12. void uTurn (){
  13. moveForward();
  14. turnLeft();
  15. repeat(3){
  16. moveForward();
  17. }
  18. turnLeft();
  19. moveForward();
  20. }
  21.  
  22. void obtainArtifact(){
  23. turnRight();
  24. uTurn();
  25. pickBeeper();
  26. uTurn();
  27. dropBeeper();
  28. }
  29.  
  30. /*--------------------------------- 1.1.2 ----------------------------------------------------*/
  31.  
  32. void moveToWall(){
  33. repeat(9){
  34. moveForward();
  35. }
  36. }
  37. void defuseOneBomb(){
  38. moveToWall();
  39. pickBeeper();
  40. turnAround();
  41. moveToWall();
  42. turnAround();
  43. }
  44.  
  45. /*--------------------------------- 1.1.3 ----------------------------------------------------*/
  46.  
  47. void defuseTwoBombs(){
  48. defuseOneBomb();
  49. turnLeft();
  50. defuseOneBomb();
  51. }
  52.  
  53. /*--------------------------------- 1.1.4 ----------------------------------------------------*/
  54.  
  55. void practiceHomeRun(){
  56. repeat(4){
  57. moveToWall();
  58. pickBeeper();
  59. turnLeft();
  60.  
  61. }
  62. }
  63.  
  64. /*--------------------------------- 1.2.1 ----------------------------------------------------*/
  65.  
  66. void climbOneStair(){
  67. turnLeft();
  68. moveForward();
  69. turnRight();
  70. moveForward();
  71. }
  72.  
  73. void climbTheStairs(){
  74. moveForward();
  75. repeat(6){
  76. climbOneStair();
  77. }
  78. }
  79.  
  80. /*--------------------------------- 1.2.2 ----------------------------------------------------*/
  81.  
  82. void stepRight(){
  83. moveForward();
  84. turnRight();
  85. moveForward();
  86. }
  87.  
  88. void fillTheHoles(){
  89. repeat(4){
  90. stepRight();
  91. dropBeeper();
  92. turnAround();
  93. stepRight();
  94. }
  95. }
  96.  
  97. /*--------------------------------- 1.2.3 ----------------------------------------------------*/
  98.  
  99.  
  100.  
  101. void saveTheFlower(){
  102. moveForward();
  103. pickBeeper();
  104.  
  105. repeat(4){
  106. turnLeft();
  107. moveForward();
  108. moveForward();
  109. turnRight();
  110. moveForward();
  111. }
  112.  
  113. dropBeeper();
  114.  
  115. repeat(4){
  116. moveForward();
  117. turnRight();
  118. moveForward();
  119. moveForward();
  120. turnLeft();
  121. }
  122. }
  123.  
  124. /*--------------------------------- 1.2.4 ----------------------------------------------------*/
  125.  
  126. void sharpTurnLeft()
  127. {
  128. turnLeft();
  129. moveForward();
  130. turnLeft();
  131.  
  132. }
  133.  
  134. void sharpTurnRigth()
  135. {
  136. turnRight();
  137. moveForward();
  138. turnRight();
  139.  
  140. }
  141.  
  142. void mowOneRow()
  143. {
  144. repeat(6){
  145. moveForward();
  146. pickBeeper();
  147. }
  148. moveForward();
  149. }
  150.  
  151. void mowTheLawn()
  152. {
  153. repeat(2){
  154. mowOneRow();
  155. sharpTurnLeft();
  156. mowOneRow();
  157. sharpTurnRigth();
  158. }
  159. mowOneRow();
  160. sharpTurnLeft();
  161. mowOneRow();
  162.  
  163. }
  164.  
  165. /*--------------------------------- 1.3.1 ----------------------------------------------------*/
  166.  
  167. void harvestARow(){
  168.  
  169. repeat(4){
  170. moveForward();
  171. pickBeeper();
  172. turnRight();
  173.  
  174. moveForward();
  175. turnLeft();
  176. }
  177. }
  178.  
  179. void harvestDoubleRows(){
  180.  
  181. harvestARow();
  182. repeat(2) {
  183. moveForward();
  184. moveForward();
  185. turnLeft();
  186. }
  187. harvestARow();
  188. }
  189.  
  190.  
  191. void harvestTheField(){
  192.  
  193. harvestDoubleRows();
  194. turnAround();
  195. harvestDoubleRows();
  196. }
  197.  
  198.  
  199. /*--------------------------------- 1.3.2 ----------------------------------------------------*/
  200.  
  201. void repairTheStreet(){
  202. repeat(10){
  203. if(rightIsClear())
  204. {
  205. turnRight();
  206. moveForward();
  207. dropBeeper();
  208. turnAround();
  209. moveForward();
  210. turnRight();
  211.  
  212. }
  213. if(frontIsClear())
  214. {
  215. moveForward();
  216.  
  217. }
  218. }
  219. }
  220.  
  221. /*--------------------------------- 1.3.3 ----------------------------------------------------*/
  222.  
  223. void cleanRow(){
  224. repeat(10){
  225. if(onBeeper()){
  226. pickBeeper();
  227. }
  228. if(frontIsClear()){
  229. moveForward();
  230. }
  231. }
  232. }
  233.  
  234. void cleanTheRoom(){
  235. repeat(5){
  236. cleanRow();
  237. sharpTurnLeft();
  238. cleanRow();
  239. if(rightIsClear()){
  240. sharpTurnRigth();
  241. }
  242. }
  243. }
  244.  
  245. /*--------------------------------- 1.3.4 ----------------------------------------------------*/
  246.  
  247. void tileTheFloor(){
  248.  
  249. repeat(100)
  250. {
  251. dropBeeper();
  252. if(frontIsClear() && !beeperAhead()){
  253. moveForward();
  254. }
  255. else
  256. {
  257. turnLeft();
  258. moveForward();
  259. }
  260. }
  261. }
  262.  
  263. /*--------------------------------- 1.4.1 ----------------------------------------------------*/
  264.  
  265. void stealOlympicFire(){
  266.  
  267. climbTheStairs();
  268. pickBeeper();
  269. moveForward();
  270. turnRight();
  271. repeat(6){
  272. moveForward();
  273. }
  274. turnLeft();
  275. moveForward();
  276. }
  277.  
  278. /*--------------------------------- 1.4.2 ----------------------------------------------------*/
  279.  
  280. void removeTheTiles(){
  281.  
  282. repeat(100)
  283. {
  284. pickBeeper();
  285. if(!beeperAhead()){
  286. turnLeft();
  287. }
  288. moveForward();
  289. }
  290. }
  291.  
  292. /*--------------------------------- 1.4.3 ----------------------------------------------------*/
  293.  
  294. void walkTheLabyrinth(){
  295.  
  296. repeat(99){
  297. if(!frontIsClear()){
  298. if(leftIsClear()){
  299. turnLeft();
  300. }
  301. else {
  302. turnRight();
  303. }
  304. }
  305. moveForward();
  306. }
  307. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement