function go()
  turtle.dig()
  turtle.down()
  turtle.forward()
end

while turtle.detect() do
  go()
end