Jump to content




Condition with not makes loops not run


  • You cannot reply to this topic
1 reply to this topic

#1 Lord_of_Life

  • New Members
  • 1 posts

Posted 23 June 2014 - 11:25 PM

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.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 23 June 2014 - 11:55 PM

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())






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users