Posted 14 January 2013 - 07:43 AM
My idea was to have a turtle who will go and build me a wall (I know there's probably a bunch of people who have already done this, but I wanted to program my own version) and I've encountered a problem; the turtle will only build 2 wide.
Any help?
print("How High?")
high = tonumber(read())
print("How Long?")
long = tonumber(read())
y = high
x = long
u = 0
while y>0 do
turtle.place()
turtle.up()
y = y-1
end
if y == 0 then
if x>0 then
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.down()
x = x-1
u = high
end
end
while u>0 do
turtle.place()
turtle.down()
u = u-1
end
if u == 0 then
if x>0 then
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.up()
x = x-1
y = high
return
end
end
Any help?
print("How High?")
high = tonumber(read())
print("How Long?")
long = tonumber(read())
y = high
x = long
u = 0
while y>0 do
turtle.place()
turtle.up()
y = y-1
end
if y == 0 then
if x>0 then
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.down()
x = x-1
u = high
end
end
while u>0 do
turtle.place()
turtle.down()
u = u-1
end
if u == 0 then
if x>0 then
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.up()
x = x-1
y = high
return
end
end