Posted 07 November 2012 - 03:40 AM
Hello,
I just started trying to learn computercraft coding as of last night and I'm completely hooked. Never tried coding anything else before other than like… excel cells lol.
So anyways, I'm trying to learn how to use user defined variables to tell how far a turtle should go/dig/etc. Here is my attempt:
However, no matter what input I give it, it will just go forward indefinetly. What am I doing wrong/not understanding? Thanks.
I just started trying to learn computercraft coding as of last night and I'm completely hooked. Never tried coding anything else before other than like… excel cells lol.
So anyways, I'm trying to learn how to use user defined variables to tell how far a turtle should go/dig/etc. Here is my attempt:
print("Please type how far you want to go")
z = read()
x = 0
while x ~= z do
turtle.forward()
x = x+1
end
However, no matter what input I give it, it will just go forward indefinetly. What am I doing wrong/not understanding? Thanks.