Guest User

move

a guest
Jan 27th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | None | 0 0
  1. while true do
  2.  local action = math.random(1,6)
  3.  
  4.  
  5.  if action == 1 then
  6.   turtle.turnLeft()
  7.  end
  8.  
  9.  if action == 2 then
  10.   turtle.turnRight()
  11.  end
  12.  
  13.  if action == >= 3 and action <= 6 then
  14.   local distance = math.random(1,5)
  15.   for i = 1,distance do
  16.    turtle.forward()
  17.   end
  18.  end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment