Posted 03 August 2015 - 03:26 AM
The following code receives the error "bios:367: [string "makeHouse"]:22:syntax error
I tried the code in lua mode with the following code on the turtle but it worked fine.
What's wrong?
local length = ""
local width = ""
term.write("How long should the house be? ")
length = read()
term.write("How wide should the house be? ")
width = read()
function adjustStack()
local dealer = turtle.getItemCount(1)
local frog = 2
local buttz = 2
while dealer < 1 do
turtle.select(frog)
dealer = turtle.getItemCount(frog)
butts = frog + 1
frog = butts
end
end
function frontSection(c)(z)
isFrontEven = c % 2
if z ~= 3 then
if isFrontEven == 1 then
d = c - 3
c = d / 2
else
d = c - 2
c = d / 2
end
for a = 1, c do
turtle.placeDown()
adjustStack()
turtle.forward()
end
if isFrontEven == 0 then
turtle.forward()
end
for b = 1, c do
turtle.placeDown()
adjustStack()
turtle.forward()
end
end
else
for g = 1, c do
turtle.placeDown()
adjustStack()
turtle.forward()
end
print("Creating House")
turtle.select(1)
adjustStack()
for u = 1, 3 do
turtle.up()
turtle.forward()
for e = 1, 3 do
for l = 1, length do
turtle.placeDown()
turtle.forward()
adjustStack()
end
turtle.turnLeft()
turtle.forward()
for w = 1, width do
turtle.placeDown()
turtle.forward()
adjustStack()
end
turtle.turnLeft()
turtle.forward()
for p = 1, length do
turtle.placeDown()
adjustStack()
turtle.forward()
end
turtle.turnLeft()
turtle.forward()
frontSection(width)(u)
turtle.turnLeft()
turtle.forward()
end
end
print("Looky here, I made a house!")
I tried the code in lua mode with the following code on the turtle but it worked fine.
isFrontEven = 4 % 2
print(isFrontEven)
isFrontEven = 5 % 2
print(isFrontEven)
What's wrong?