This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lord_of_Life's profile picture

Condition with not makes loops not run

Started by Lord_of_Life, 23 June 2014 - 10:25 PM
Lord_of_Life #1
Posted 24 June 2014 - 12:25 AM
http://pastebin.com/b39zT5Cw

Turtle should build a W x L platform in a spiraling pattern.
The problem is in the conditions of the while loops, but I don't know how to fix it.
Both == and not == give false.
Lyqyd #2
Posted 24 June 2014 - 12:55 AM
I think you may actually be looking for for loops.

For instance, you'd replace your first loop with:


for i = 1, L do
  turtle.forward()
  turtle.placeDown()
end

You are also going to want to tonumber() the results of the read() calls, since read always returns a string:


local W = tonumber(read())