2 posts
Posted 31 August 2013 - 02:56 AM
Title: Ignoring Conditional
I was making a quarry program and after it does one layer i want it to go down and i have a conditional to check for that, but it seems to be ignoring it, i don't know why it is doing that, maybe one of you guys can figure that out for me. thanks in advancehttp://pastebin.com/tLNdmWbt
1190 posts
Location
RHIT
Posted 31 August 2013 - 08:50 AM
Split into new topic.
19 posts
Posted 31 August 2013 - 09:25 AM
I suppose the conditional that doesn't work is this one:
if p == i then
The variable i is nil at this point of the program, it only has a value inside the for-loop.
After that, it has the value it has before the loop, which is nil.
2 posts
Posted 31 August 2013 - 02:39 PM
I suppose the conditional that doesn't work is this one:
if p == i then
The variable i is nil at this point of the program, it only has a value inside the for-loop.
After that, it has the value it has before the loop, which is nil.
ok i see but when i change it to this
http://pastebin.com/UrFVzrG4the turtle isnt crashing but it is not going down but instead is continuing the quarry but sideways.
btw p == i didnt work because the moment it starts it will be true because 1 == 1.
259 posts
Posted 31 August 2013 - 03:28 PM
I suppose the conditional that doesn't work is this one:
if p == i then
The variable i is nil at this point of the program, it only has a value inside the for-loop.
After that, it has the value it has before the loop, which is nil.
ok i see but when i change it to this
http://pastebin.com/UrFVzrG4the turtle isnt crashing but it is not going down but instead is continuing the quarry but sideways.
btw p == i didnt work because the moment it starts it will be true because 1 == 1.
Just a guess, but try doing this on line 15
if (p + i) == (tArgs[1] + tArgs[2] - 1) then
hopefully the issue was that it wasn't doing the math on each side at the same time or something.