cecell

Turtle Turn

Apr 28th, 2014
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. local tArgs = { ... }
  2. local nDir = tArgs[1]
  3.  
  4. if not nDir then
  5.         print("Usage: turn <direction>")
  6.     print("Valid directions: L, R")
  7.     return
  8. end
  9.  
  10. if nDir == "l" then
  11.     turtle.turnLeft()
  12.     return
  13. end
  14.  
  15. if nDir == "r" then
  16.     turtle.turnRight()
  17.     return
  18. end
  19.  
  20. print("You must enter a valid direction.")
  21. print("Valid directions: L, R")
Advertisement
Add Comment
Please, Sign In to add comment