c++ how to loop code in a different way?(not the kind you think)
<p>Ok, so I'm trying to make a VERY simple text roleplay game and I'm having a problem. I don't know what kind of loop I could use to loop this code:</p>

<pre><code>getline(cin, response);
if(response == "Pick up the gun")
{
    cout &lt;&lt; "You pick up the gun.\n";
    cout &lt;&lt; "Knock down the door with it? (Y/N)\n";
    getline(cin, response);
    if(response == "Y")
    {
        cout &lt;&lt; "The door opens.\n";
        cout &lt;&lt; "You see a zombie.\n";
        cout &lt;&lt; "You see an open window.\n";
        cout &lt;&lt; "What do you do?\n";
        getline(cin, response);
        if(response == "Shoot the zombie")
        {
            cout &lt;&lt; "The zombie dies and it attracts other zombies.\n";
            cout &lt;&lt; "GAME OVER!\n";
            cin.get();
            return 0;
        }
        else if(response == "Jump out the window")
        {
            cout &lt;&lt; "The zombie does not hear you and you safely make it out!\n";
            cout &lt;&lt; "VICTORY!\n";
            cin.get();
            return 0;
        }
    }
    else if(response == "N")
    {
    }
}
else if(response == "Open the door")
{
    cout &lt;&lt; "It appears to be locked.\n";
}
</code></pre>

<p>So if they get it wrong(for example, they choose 'open the door' it will just say its locked and it will END THE PROGRAM for some reason. I WANT it the user to be able to choose a different choice, not have it just be blank or broken or end etc.)it would just loop, but when i try it either doesent end the program and just makes it weher i can type and nothing happens no matter what, or it absoulutley SPAMS the text like 100 times and i can't do anything etc. its very strange. so how could I do that? thx!</p>
