1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
#include <iostream>
#include <string>
#include <fstream>
#include <list>
using namespace std;
int score;
int main()
{
const string Teams[20] = { "Leicester City", "Tottenham Hotspur", "Liverpool", "Southampton", "Chelsea", "Aston Villa", "Everton", "Crystal Palace", "Wolverhampton Wanderers", "Manchester City", "Arsenal", "West Ham United", "Newcastle United", "Manchester United", "Leeds United", "Brighton and Hove Albion", "Fulham", "West Bromwich Albion", "Burnley", "Sheffield United" };
const string Characters[11] = { "Bilbo Baggins", "Smaug", "Elrond", "Gollum", "Gandalf", "Thorin Oakenshield", "Oin","Gloin", "Dori", "Nori", "Ori" };
const string Countries[12] = { "Argentina", "Bolivia", "Brazil", "Chile", "Colombia", "Ecuador", "Guyana", "Paraguay", "Peru", "Suriname", "Uruguay", "Venezuela" };
//this is where the potential answers are stored on the code, to be called upon by the questions, i would have used this array instead of calling upon files, however i could not get the code to function correctly when i attempted it this way, so i have simplified it for functionality.
string answer1 = "Arsenal";
// this is the correct answer that the player needs to input for question 1
string answer2 = "Liverpool";
// this is the correct answer that the player needs to input for question 2
string answer3 = "Argentina";
// this is the correct answer that the player needs to input for question 3
string answer4 = "Guyana";
// this is the correct answer that the player needs to input for question 4
string answer5 = "Gandalf";
// this is the correct answer that the player needs to input for question 5
string guess;
// this is how we read the players guess
cout << "Richard Osman's house of games,\nThis round is in code.\n";
cout << "The objective of this round is to unscramble the coded word, you will be given the category as the clue and you have to type out what you belive the answer to be, with a capital letter";
cout << endl;
string Name;
cout << "Enter your first name.\n";
cin >> Name;
cout << "Welcome contestant " << Name << " Are you ready to begin the quiz?\n";
// this is to add a level of immersion to the game, by allowing the code to recall the players name so that they have a personalised experience
string respond;
cout << "please type Yes or No (case sensitive).\n";
cin >> respond;
if (respond == "Yes")
{
cout << "\nGood luck!";
}
else
{
cout << "Maybe next time!";
return 0;
}
cout << "The category is..." << endl;
cin.get();
cout << "Premier League Football Teams (press enter)" << endl;
cin.get();
cout << "What Team is this?" << endl << endl;
cout << "[1] {18] [19] [5] [14] [1] [12]" << endl << endl;
cin >> guess;
if (guess == answer1) {
cout << "Nice job " << Name << ", press enter to continue to the next question" << endl;
score = score + 1;
} else {
cout << "Sorry " << Name << ", that was incorrect, press enter to continue to the next question" << endl;
}
cin.get();
cout << "next category is... Premier leaugue football teams. (press enter to continue)" << endl << endl;
cin.get();
cin.get();
cout << "What Team is this?" << endl;
cout << "[12] [9] [22] [5] [18] [16] [15] [15] [12]" << endl;
cin >> guess;
if (guess == answer2) {
cout << "Nice job " << Name << ", press enter to continue to the next question" << endl;
score = score + 1;
// this is the score system that will only increase your score when you get a question correct
} else {
cout << "Sorry " << Name << ", that was incorrect, press enter to continue to the next question" << endl;
}
cout << "next category is... South American countries. (press enter to continue)" << endl << endl;
cin.get();
cin.get();
cout << "What country is this?" << endl;
cout << "[1] [18] [7] [5] [14] [20] [9] [14] [1]" << endl;
cin >> guess;
if (guess == answer3) {
cout << "Nice job " << Name << ", press enter to continue to the next question" << endl;
score = score + 1;
} else {
cout << "Sorry " << Name << ", that was incorrect, press enter to continue to the next question" << endl;
}
cout << "next category is... South American countries. (Press enter to continue)" << endl << endl;
cin.get();
cin.get();
cout << "What country is this?" << endl;
cout << "[7] [21] [25] [1] [14] [1]" << endl;
cin >> guess;
if (guess == answer4) {
cout << "Nice job " << Name << ", press enter to continue to the next question" << endl;
score = score + 1;
} else {
cout << "Sorry " << Name << ", that was incorrect, press enter to continue to the next question" << endl;
}
cout << "next category is... Hobbit Characters.(Press enter to continue)" << endl << endl;
cin.get();
cin.get();
cout << "What Character is this?" << endl;
cout << "[7] [1] [14] [4] [1] [12] [6]" << endl;
cin >> guess;
if (guess == answer5) {
cout << "Nice job " << Name << ", press enter to continue to the next question" << endl;
score = score + 1;
} else {
cout << "Sorry " << Name << ", that was incorrect, press enter to continue to the next question" << endl;
}
cout << "Congratulations " << Name << "! you have completed the game" << endl;
cout << "Your final score was " << score << " Points";
int letter = 26;
switch (letter) {
case 'a':
cout << "1";
break;
case 'b':
cout << "2";
break;
case 'c':
cout << "3";
break;
case 'd':
cout << "4";
break;
case 'e':
cout << "5";
break;
case 'f':
cout << "6";
break;
case 'g':
cout << "7";
break;
case 'h':
cout << "8";
break;
case 'i':
cout << "9";
break;
case 'j':
cout << "10";
break;
case 'k':
cout << "11";
break;
case 'l':
cout << "12";
break;
case 'm':
cout << "13";
break;
case 'n':
cout << "14";
break;
case 'o':
cout << "15";
break;
case 'p':
cout << "16";
break;
case 'q':
cout << "17";
break;
case 'r':
cout << "18";
break;
case 's':
cout << "19";
break;
case 't':
cout << "20";
break;
case 'u':
cout << "21";
break;
case 'v':
cout << "22";
break;
case 'w':
cout << "23";
break;
case 'x':
cout << "24";
break;
case 'y':
cout << "25";
break;
case 'z':
cout << "26";
break;
// This is where the question would converts the answer into a number instead of the letters of the word, the answer will still be accpeted as the word.
return 0;
}}
|