Posted 23 December 2012 - 07:28 AM
I am working on getting a building program working and for some reason 2 lines are not working as expected. but the rest works fine as expected.
If statmenst on line 18 and 25 are to check if the for loop is at the end and if it is not exicute the lines of code otherwise ignore them if it is at the end. this uses my own turtle movement API, "PI".
API functions used:
Spoiler
local tArgs = { ... }
if #tArgs < 1 then
print( "house size <straight> <right>" )
return
end
x=tArgs[1]
z=tArgs[2]
print(x)
print(z)
PI.mFw()
for i = 1, z do
for I = 1, x do
if not PI.pBD() then
PI.bBD()
PI.pBD()
end
print("I: "..I.." x: "..x)
if I ~= x then --line 18
PI.mFw()
end
end
m = i%2
print("i % 2 = "..m)
print("i: "..i.." z: "..z)
if i ~= z then --line 25
if (m) == 1 then
PI.tR()
PI.mFw()
PI.tR()
else
PI.tL()
PI.mFw()
PI.tL()
end
end
end
API functions used:
- PI.mFw() = move Forward
- PI.tL() == turn Left
- PI.tR() == turn Right
- PI.pBD() = place Block Down
- PI.bBD() = break Block Down