Title: What is wrong with this?
I have this bit of code:
Print("which direction?")
Local direction = read()
Print("how many times?")
Local times = read()
Term.write("moving"..direction ..times "times")
And it just says:
Move:6: attempt to call string
What is wrong with this?
Started by Lockandload1996, Feb 08 2013 12:27 PM
3 replies to this topic
#1
Posted 08 February 2013 - 12:27 PM
#2
Posted 08 February 2013 - 01:08 PM
You're missing the two dots in line 6 between times and "times"
Term.write("moving"..direction ..times.."times")
Also lua is case-sensitive print,local and term start should not start with capital letters.
Term.write("moving"..direction ..times.."times")
Also lua is case-sensitive print,local and term start should not start with capital letters.
#4
Posted 08 February 2013 - 08:08 PM
Yeah, cause it would have been an attempt to call nil error on the first line otherwise. So, a reminder, post your exact code inside of a code box (by typing [CODE][/CODE] around it or by hitting that little button that looks like a blue <> above the post input), so that we can actually distinguish the error from your various typos and such.
Longer programs should be on pastebin.
Longer programs should be on pastebin.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












