
-----------------------------------
Teree
Mon Apr 25, 2016 3:23 pm

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


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]

-----------------------------------
Insectoid
Tue Apr 26, 2016 2:57 pm

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?)
