Talk:Turtle API/@comment-66.76.156.105-20120906170226/@comment-180.222.68.193-20120907194611

here is a little function i wrote to dig all gravel/sand from above the turtle

digup=function

while turtle.detectUp do

turtle.digUp

os.sleep(1)

end

end

note, using "if true" will always happen and using "if false" will never happen

this will print a console message if there is a block in front of the turtle

if turtle.detect then print "there is a block in front of me"