This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
chriskopp7's profile picture

[Help][turtle] Why is it building this[Help][turtle]

Started by chriskopp7, 24 October 2012 - 12:44 PM
chriskopp7 #1
Posted 24 October 2012 - 02:44 PM
I should have it set to build this



But it builds this:





and the loop does not work

here is my code


local  i = 1
function Row()
turtle.forward()
turtle.turnRight()
turtle.placeDown()
turtle.forward()
turtle.down()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.up()
turtle.placeDown()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
end
term.clear()
term.setCursorPos(1,1)
write("Please enter how many row you want:")
a = read()
repeat
Row()
i = 1 + 1
until 1 == a
chriskopp7 #2
Posted 24 October 2012 - 02:50 PM
This is one of my first build with turtle so i kinda have no clue what i am doing
Ditto8353 #3
Posted 24 October 2012 - 02:51 PM
You need a 'forward' right after the 'up'
You should also use a for loop.
for i=1,a do
	Row()
end
In the code you posted, i will always be 2, so it will never stop building unless you input '2'
chriskopp7 #4
Posted 24 October 2012 - 02:54 PM
You need a 'forward' right after the 'up'
You should also use a for loop.
for i=1,a do
	Row()
end
In the code you posted, i will always be 2, so it will never stop building unless you input '2'

Thanks for your help ^_^/>/> will test now