lost_RD

Reggie_walk v2

Sep 22nd, 2015
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. directions= {forward="forward", back="back", up="up", down="down", left="turnLeft", right="turnRight"}
  2.  
  3. print("My name is Reggie, and I'm learning to walk.")
  4.  
  5. while true do
  6.   print("What direction should I go [forward, back, up, down] or should I turn [left, right]")
  7.   direction = read()
  8.  
  9.   print ("How far shall I go?")
  10.   distance = tonumber(read())
  11.  
  12.   for i=1,distance do
  13.     turtle[directions[direction]]()
  14.   end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment