I have probably a very simple problem, but as a newbie in programming I just can't find solution even with multiple tries and errors. I'm training what I've learned so far on a simple text based adventure game, which I'm having problems with. For the first I'm using strings and I can't make it to use two strings in if to cout a proper situation.
#include<iostream>
#include <string>
using namespace std;
int main ()
{
string podpalam = "podpalam";
string papier = "papier";
cout << "Stoisz w wielkim ciemny pokoju. W reku trzymasz kawalek PAPIERU, \n a w kieszeni spoczywa pudelko ZAPALEK. Co robisz?" << endl;
cin >> podpalam >> papier;
if ( podpalam == "podpalam")
cout << "Pokoj rozswietla sie od plomieni palacej sie kartki.";
else
cout << "Pomysl przez chwile. To niekoniecznie prawidlowe wyjscie." << endl;
cout << " \nKoniec" << endl;
return 0;
}
So as you can see I have two strings, both called differently, but only one is added to if, but still you need to cin another string to move forward with the adventure, but the second string can be just a simple letter or symbol. I tried adding two strings to if, but I just can't. Maybe it's impossible and I'm fighting with air, but I've seen games like Zork that used two words and worked perfect.
The other thing is that I don't want my program to end when you make mistake, I want it to restart again. Like you made a mistake, you died and now you can start again. Don't really know the command for it and couldn't find the answer in Google or Youtube.