1 posts
Posted 08 February 2013 - 12:27 PM
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
286 posts
Location
Bonn Germany
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.
2088 posts
Location
South Africa
Posted 08 February 2013 - 07:08 PM
Also lua is case-sensitive print,local and term start should not start with capital letters.
I think he re-typed it.
2005 posts
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.