Posted 09 December 2012 - 07:29 PM
Hi, I am fairly new to ComputerCraft (and programming) and I wanted to make a trurtle quarry.
This is what I have so far:
If you have time it would be great to get some responses! Thanks! :D/>
This is what I have so far:
print("How many forward?")
forw= read()
print("How many down?")
down = read()
for p = 1, down do
for i = 1, forw do
turtle.dig()
turtle.forward()
end
turtle.digDown()
turtle.down()
turtle.turnLeft()
turtle.turnLeft()
if p == down then
for p = 1, down do
turtle.up()
end
end
end
What it does right now is read how wide the quarry should be, how far down it should go, and then dig that area. (Keep in mind that this is just one row of the quarry. I would want to have multiple turtles next to each other running the same program) My problem is the last bit of code at the end. When it is finished I want it to return to the surface, where it started. I thought I could do this by running a for loop for as many times as I told it to go down but it doesn't seem to work. It ignores it entirely. I don't know if I am even able to do it this way or if I just derped and did something stupid.If you have time it would be great to get some responses! Thanks! :D/>