while turtle.detect() do turtle.select(1) if turtle.compare() then turtle.dig() turtle.forward() else return end end