63 posts
Location
The Netherlands
Posted 16 March 2012 - 12:13 PM
So like:
a = "to"
b = "far"
c = "lands"
write("A, b or c ")
toPrint = read()
print(toPrint)
Thx for the help if someone helps
715 posts
Posted 16 March 2012 - 12:44 PM
There are several ways to do this, for example:
Spoiler
local a = "to"
local b = "far"
local c = "lands"
write("A, b or c ")
local toPrint = read()
if string.lower(toPrint) == "a" then print( a )
if string.lower(toPrint) == "b" then print( b )
if string.lower(toPrint) == "c" then print( c )
… or …
Spoiler
local tToPrint = {}
tToPrint.a = "to"
tToPrint.b = "far"
tToPrint.c = "lands"
write("A, b or c ")
local input = read()
print(tToPrint[input])
But I'd suggest you start with some tutorials in this section:
http://www.computerc...m/13-tutorials/Also I'd recommend trying this program, which is kind of an interactive learning tutorial for CC that you can use ingame:
http://www.computerc...torial-in-game/
63 posts
Location
The Netherlands
Posted 16 March 2012 - 03:09 PM
Thx, but i dont need a tutorial, this was one of the small things i dont know, as im making a secret program… I think its going to be like 1000 - 5000 lines :D/>/>
63 posts
Location
The Netherlands
Posted 16 March 2012 - 03:16 PM
And cant it be compacter; I got like 64 variables… And they need to be editable by some commands
724 posts
Posted 17 March 2012 - 05:48 AM
Second example is compact enough for you. You need tutorial to understand.
63 posts
Location
The Netherlands
Posted 17 March 2012 - 09:25 AM
lol i saw the second one later lol, srry