Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 choosing lines of command to run
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Teree




PostPosted: Mon Apr 25, 2016 3:23 pm   Post subject: choosing lines of command to run

I'm trying to make a game

Problem
I'm not sure how to make the program choose a set of commands based on the input. I am very new to coding

this is where i want to put it, but im not sure what to do
Turing:


if gametype = "Memory Game" then

    exit when Exit = 1
elsif gametype = "Memory Game" then

    exit when Exit = 1
end if



Version of Turing
4.1[/b]
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Tue Apr 26, 2016 2:57 pm   Post subject: RE:choosing lines of command to run

I'm not sure what you're asking. You're describing an if statement. If the player enters something, then do something. If the player enters something else, then do something else. You seem to understand this based on the code you posted (although checking for 'Memory Game' twice won't help you much. Maybe change the elsif to a different game?)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: