Posted 18 June 2013 - 08:51 PM
Hello, I am trying to get my loop to break before line 12. Lets say the user inputs 7 as w. I want lines 4-7 to be executed 7 times while lines 12-14 are only executed 6 times. However even with the break in the loop lines 12-14 are still being executed 7 times.
- local izard = 0
- function length()
- for loop = 1, w do– w is a number that the user inputs.
- Dig.drill(l-1)– another function in my quarry program.
- for j = 2, l do
- turtle.back()
- end
- izard=izard+1
- if izard == w then
- break
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- end