Advertisement
Guest User

replace

a guest
Oct 13th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. function fw()
  2.  turtle.digDown()
  3.  turtle.forward()
  4. end
  5. function turn(x)
  6.  if x % 2 == 0 then
  7.   right = true
  8.   left = false
  9.  else
  10.   right = false
  11.   left = true
  12.  end
  13.  turtle.digDown()
  14.  if right then
  15.   turtle.turnRight()
  16.  else if left then
  17.   thurtle.turnLeft()
  18.  end
  19. end
  20.  
  21. while true do
  22.  if turtle.detect() then
  23.   turn()
  24.  else
  25.   fw()
  26.  end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement