Permalink
Cannot retrieve contributors at this time
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?
Team-Froggies-4007CEM/room_2.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
52 lines (50 sloc)
1.35 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} | |
} | |
} | |
} | |
} |