Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <string>
#include <iostream>
using namespace std;
int room2()
{
string userChoice;
bool keypadTrue = false;
string keypadChoice;
string keypadAnswer;
//while loop to repeat until the keypad is unlocked
while(keypadTrue == false)
{
//takes user input for where they would like to explore, with if statements giving the player descriptions and more information
cout << "Where would you like to explore?\n1 - Chair\n2- Desk\n3 -Wall\n4- Rug\n5- Keypad\n " <<endl;
cin >> userChoice;
if (userChoice == "1")
{
cout<< room2chair << endl;
}
else if (userChoice == "2")
{
cout<< room2desk << endl;
}
else if (userChoice == "3")
{
cout<< room2wall << endl;
}
else if (userChoice == "4")
{
cout<< room2rug << endl;
}
else if (userChoice == "5")
{
cout<< room2keypad << endl;
cout<<"1 - Enter code\n2 - Leave"<<endl;
cin >> keypadChoice;
if(keypadChoice == "1")
{
// User enters the passcode to open the door, if statements check if it is correct allowing for both lowercase and uppercase inputs
cout<<"Please enter the code:\n" <<endl;
cin >> keypadAnswer;
if(keypadAnswer == "help" or keypadAnswer == "HELP")
{
keypadTrue = true;
cout<< room2end << endl;
}
}
}
}
}