Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- directions= {forward="forward", back="back", up="up", down="down", left="turnLeft", right="turnRight"}
- print("My name is Reggie, and I'm learning to walk.")
- while true do
- print("What direction should I go [forward, back, up, down] or should I turn [left, right]")
- direction = read()
- print ("How far shall I go?")
- distance = tonumber(read())
- for i=1,distance do
- turtle[directions[direction]]()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment