Advertisement
dabako

Untitled

Feb 25th, 2020
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function turnRobot(turnedLeft)
  2. movedBlocks = 0
  3. if (turnedLeft == true)
  4. then
  5. robot.turnRight()
  6. while(movedBlocks < 3) do
  7. robot.swing(sides.front)
  8. robot.forward(1)
  9. movedBlocks = movedBlocks + 1
  10. end
  11. robot.turnRight()
  12. turnedLeft = false
  13. end
  14.  
  15. if (turnedLeft == false)
  16. then
  17. robot.turnLeft()
  18. while( movedBlocks < 3) do
  19. robot.swing(sides.front)
  20. robot.forward(1)
  21. end
  22. robot.turnLeft()
  23. turnedLeft = true
  24. end
  25. return turnedLeft;
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement