Advertisement
mrzrashed

AI_LAB_1

May 24th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. 1
  2. moveForward();
  3. moveForward();
  4.  
  5. 2
  6. moveForward();
  7. turnLeft();
  8. moveForward();
  9. turnRight();
  10. moveForward();
  11. 3
  12. while (notDone()) {
  13. moveForward();
  14. }
  15. 4
  16. while (notDone()) {
  17. moveForward();
  18. turnLeft();
  19. moveForward();
  20. turnRight();
  21. }
  22.  
  23. 5
  24. moveForward();
  25. moveForward();
  26. turnLeft();
  27. while (notDone()) {
  28. moveForward();
  29. }
  30. 6
  31. while (notDone()) {
  32. moveForward();
  33. if (isPathLeft()) {
  34. turnLeft();
  35. }
  36. }
  37.  
  38.  
  39. 7
  40. while (notDone()) {
  41. moveForward();
  42. if (isPathRight()) {
  43. turnRight();
  44. }
  45. }
  46.  
  47. 8
  48. while (notDone()) {
  49. moveForward();
  50. if (isPathLeft()) {
  51. turnLeft();
  52. }
  53. if (isPathRight()) {
  54. turnRight();
  55. }
  56. }
  57. 9
  58. while (notDone()) {
  59. if (isPathForward()) {
  60. moveForward();
  61. if (isPathLeft()) {
  62. turnLeft();
  63. }
  64. } else {
  65. turnRight();
  66. }
  67. }
  68. 10
  69. moveForward();
  70. moveForward();
  71. turnLeft();
  72. while (notDone()) {
  73. if (isPathForward()) {
  74. moveForward();
  75. if (isPathRight()) {
  76. turnRight();
  77. }
  78. } else {
  79. turnLeft();
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement