> Help with turtle programming?

Help with turtle programming?

Posted at: 2014-12-18 
Making a basic program for cutting down trees, Ive got 2 seperate programs but they both dont work very well.

for the first program it only cuts down trees straight in front of it. The second program just sucks.

First Program:

for anthony = 1 , 50 do

turtle.forward()

while turtle.detect() == true do

turtle.dig()

turtle.forward()

turtle.digUp()

turtle.up()

turtle.digUp()

turtle.up()

turtle.digUp()

turtle.down()

turtle.down()

end

turtle.forward()

end

Second Program:

for anthony = 1 , 50 do

turtle.forward()

while turtle.detect() == true do

turtle.dig()

turtle.forward()

turtle.digUp()

turtle.up()

turtle.digUp()

turtle.up()

turtle.digUp()

turtle.down()

turtle.down()

turtle.forward()

turtle.turnLeft()

turtle.forward()

end

turtle.forward()

end