Posted 11 November 2013 - 03:45 AM
Title: Nested if statements in a while loop
Hello all, I'm having some troubles with nested if/else statements in a while loop that I've created. Ideally I'd be putting curly brackets and round brackets everywhere, but because of the language I'm slightly stuck. If anyone could shed some light on the matter that would be great.
Here's the code
Hello all, I'm having some troubles with nested if/else statements in a while loop that I've created. Ideally I'd be putting curly brackets and round brackets everywhere, but because of the language I'm slightly stuck. If anyone could shed some light on the matter that would be great.
Here's the code
local roofLength = 0
local lengthCounter = 0
while lengthCounter <= roofLength do
if not turtle.detect() then
turtle.placeDown()
turtle.forward()
end
else
turtle.forward()
end
end