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_3.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
72 lines (68 sloc)
1.87 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 room3() | |
{ | |
//All the required variables are defined below | |
const string Correct_Ans = "GRBY"; | |
string User_Order; | |
bool cond = false; | |
int Hint_Counter = 0; | |
int choice; | |
cout << room3start << endl; | |
int intake; | |
// A while loop to ask the user the sequence, until they type in the correct sequence. | |
while(cond == false) | |
{ | |
cout << "What sequence would u like to go with?" << endl; | |
cin >> User_Order; | |
if(User_Order == "GYBR") | |
{ | |
cout<< "You hear a loud click, you’ve triggered something! Hurry up and keep trying!\n" << endl; | |
} | |
else if(User_Order == Correct_Ans) | |
{ | |
cout << room3correct << endl; | |
cond = true; | |
} | |
// A conditional statement which is executed when the user asks for Help(hints) | |
else if(User_Order == "HELP" or User_Order == "help") | |
{ | |
//nested if-else statements to give limited hints in the correct order. | |
if(Hint_Counter == 0) | |
{ | |
cout << room3hint1 << endl; | |
Hint_Counter = Hint_Counter + 1; | |
} | |
else if(Hint_Counter == 1) | |
{ | |
cout << room3hint2 << endl; | |
Hint_Counter = Hint_Counter + 1; | |
} | |
else | |
{ | |
cout<<"Sorry I have already given u all the hints I could, please solve the remaining part on your own"<<endl; | |
} | |
} | |
else | |
{ | |
cout << room3riddle << endl; | |
} | |
} | |
cout << room3end << endl; | |
cout << "You have reached the door please insert the key to proceed forward" << endl; | |
cout << " 1 ---> Insert the key"<< endl; | |
cin>> intake; | |
cout << Game_End << endl; | |
cout << "What is your decision?" << endl; | |
cin >> choice; | |
//A conditional statement which determines whether the user wants to go home or stay and look around the house | |
if (choice == 1) | |
{ | |
cout << Look_Around << endl; | |
} | |
else | |
{ | |
cout << Go_Home << endl; | |
} | |
} |