
-----------------------------------
aogborne
Wed Mar 30, 2016 8:14 am

If statements with more than one word
-----------------------------------
What is it you are trying to achieve?
i'm trying to make a text based game with using more than one word in a n IF statement if possible


What is the problem you are having?
it doesn't register anythign being entered 

Describe what you have tried to solve this problem
googled, tutorials, if I change it to one word it works but not 2

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




var choice : string

 put "what do you want to do"
 get choice
 
 if choice = "go north" then
 put "north"
 elsif choice = "take item" then
 put 'item'
 else
    put 'ok'
 end if




Please specify what version of Turing you are using
4.1.1

-----------------------------------
Dreadnought
Wed Mar 30, 2016 3:08 pm

Re: If statements with more than one word
-----------------------------------
Notice what happens if you type "go north" into the program below (and hit enter):

var choice : string
put "what do you want to do"
get choice
put "You typed \"", choice, "\""

As you can see get choice : *
For more details (like what happens if you use a number instead of an asterisk) see the documentation for [tdoc]get[/tdoc].

-----------------------------------
aogborne
Tue Apr 12, 2016 8:32 am

RE:If statements with more than one word
-----------------------------------
i forgot to thank you so here are some bits. +2 bits

i don't have many but enjoy.

tahnsk you dreadnought!
