Advertisement
Guest User

scriptForRobot

a guest
May 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. function goAngle(str)
  2.     robot.forward()
  3.     if str == "r" then
  4.         robot.turnRight()
  5.     end
  6.     if str == "l"
  7.         robot.turnLeft()
  8.     end
  9.     robot.forward()
  10. end
  11.  
  12. local robot = require("robot")
  13.  
  14. robot.turnRight()
  15. robot.forward()
  16. robot.turnLeft()
  17. goAngle("r")
  18. robot.forward()
  19. robot.turnLeft()
  20. goAngle("r")
  21. robot.turnLeft()
  22. robot.forward()
  23. goAngle("r")
  24. robot.turnLeft()
  25. for i = 1, 6 do
  26.     robot.forward()
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement