CODE
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
char gameSelect, diffSelect;
int main()
{
do {
// MAIN MENU
// Tells the player the different modes of play and tells them what to do to
// select one.
cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
cout << " V G W O R D S C R A M B L E ! \n";
cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
cout << "Welcome to VG Word Scramble! The game where you unscramble\n";
cout << "words to find the Video-Game related word and get points doing it!\n";
cout << "To play Word Scramble, press 'w'\n";
cout << "To play the 2-player game Scramble Battle, press 's'\n";
cout << "To play Point Attack, press 'a'\n";
cout << "To play Time Attack, press 'd'\n";
cout << "To quit press 'q'\n";
cout << "***Please note that all selections are in lower case***\n";
cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n";
cout << "Please select a game; ";
cin >> gameSelect;
while (gameSelect=='w') {
// WORD SCRAMBLE MODE
// Describes the game of Word Scramble
cout << "\n\n\n\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
cout << " W O R D S C R A M B L E \n";
cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
cout << "In this game, you must unscramble 10 words in order to\n";
cout << "complete the game. However, you only have a limited\n";
cout << "number of guesses per word, which when depleted will\n";
cout << "result in you losing a life. However, for every letter\n";
cout << "you unscramble, you gain 1 point, and for every 10\n";
cout << "points you score, you will gain an extra life. But\n";
cout << "be aware; incorrectly guessing a letter will also\n";
cout << "cost you a point! If you need help with a word,\n";
cout << "simply type 'hint', but this will cost a guess.";
cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n";
cout << "To quit during the game simply type 'quit'\n";
cout << "Difficulty levels;\nEasy - press e\nNormal - press n\nHard - press h\n";
cin >> diffSelect;
while (diffSelect=='e') {
enum fields {WORD, HINT, LETTER1, LETTER2, LETTER3, LETTER4, LETTER5, NUM_FIELDS};
const int NUM_WORDS = 15;
const string WORDS[NUM_WORDS][NUM_FIELDS] =
{
{"chaos", "Water God from Sonic Adventure.", "c", "h", "a", "o", "s"},
{"cloud", "Everyone's favourite spikey-haired hero!", "c", "l", "o", "u", "d"},
{"sonic", "He runs at the speed of light.", "s", "o", "n", "i", "c"},
{"mario", "The fat italian we all know and love", "m", "a", "r", "i", "o"},
{"zelda", "There's a big legend about her.", "z", "e", "l", "d", "a"},
{"samus", "The space-pirate's arch enemy and bounty hunter.", "s", "a", "m", "u", "s"},
{"fenix", "The XBox360's killer app's hero's second name.", "f", "e", "n", "i", "x"},
{"aeris", "She made grown men cry.", "a", "e", "r", "i", "s"},
{"kairi", "The red-head from the best Disney game ever.", "k", "a", "i", "r", "i"},
{"crash", "He's also a bandicoot", "c", "r", "a", "s", "h"},
("snake", "He's solid.", "s", "n", "a", "k", "e"),
("kirby", "The floating pink puffball", "k", "i", "r", "b", "y"),
("guile", "The blond, chisel-jawed American from Street Fighter.", "g", "u", "i", "l", "e"),
("solar", "The energy source you needed to power your gun in Boktai.", "s", "o", "l", "a", "r"),
("psone", "Sony's small version of it's first console.", "p", "s", "o", "n", "e"),
};
int word=0;
int points=0;
int total=0;
int subtotal;
int lives=3;
int guesses=5;
int letter=0;
char playon = 'y';
srand((unsigned int)time(0));
while ((lives>0)&&(playon=='y'))
{
int choice = (rand() % NUM_WORDS);
string theWord = WORDS[choice][WORD];
string theHint = WORDS[choice][HINT];
string letter1 = WORDS[choice][LETTER1];
string letter2 = WORDS[choice][LETTER2];
string letter3 = WORDS[choice][LETTER3];
string letter4 = WORDS[choice][LETTER4];
string letter5 = WORDS[choice][LETTER5];
string scramble = theWord;
int length = scramble.size();
for (int i=0;i<length;++i)
{
int index1 = (rand() % length);
int index2 = (rand() % length);
char temp = scramble[index1];
scramble[index1]=scramble[index2];
scramble[index2]=temp;
}
cout << "You're scrambled word is " << scramble;
while (letter=1)
{
string guess_one;
cout << "\nFirst letter? ";
cin >> guess_one;
while ((guess_one != letter1)&&(guess_one != "quit"));
{
if (guess_one=="hint")
{
guesses - 1;
cout << theHint;
}
else
{
cout << "Oops! That's wrong!";
guesses -1;
}
cout << "\nFirst letter? ";
cin >> guess_one;
}
if (guess_one==letter1);
{
cout << "\nCorrect! Next letter!\n";
points + 1;
letter + 1;
}
}
while (letter==2);
{
string guess_two;
cout << "\nSecond letter? ";
cin >> guess_two;
while ((guess_two != letter2)&&(guess_two != "quit"));
{
if (guess_two=="hint")
{
guesses - 1;
cout << theHint;
}
else
{
cout << "Oops! That's wrong!";
guesses -1;
}
cout << "\nSecond letter? ";
cin >> guess_two;
}
if (guess_two==letter2);
{
cout << "\nCorrect! Next letter!\n";
points + 1;
letter + 1;
}
}
while (letter==3)
{
string guess_three;
cout << "\nThird letter? ";
cin >> guess_three;
while ((guess_three != letter3)&&(guess_three != "quit"));
{
if (guess_three=="hint")
{
guesses - 1;
cout << theHint;
}
else
{
cout << "Oops! That's wrong!";
guesses -1;
}
cout << "\nThird letter? ";
cin >> guess_three;
}
if (guess_three==letter3);
{
cout << "\nCorrect! Next letter!\n";
points + 1;
letter + 1;
}
}
while (letter==4);
{
string guess_four;
cout << "\nFourth letter? ";
cin >> guess_four;
while ((guess_four != letter4)&&(guess_four != "quit"));
{
if (guess_four=="hint")
{
guesses - 1;
cout << theHint;
}
else
{
cout << "Oops! That's wrong!";
guesses -1;
}
cout << "\nFourth letter? ";
cin >> guess_four;
}
if (guess_four==letter4);
{
cout << "\nCorrect! Next letter!\n";
points + 1;
letter + 1;
}
}
while (letter==5)
{
string guess_five;
cout << "\nFifth letter? ";
cin >> guess_five;
while ((guess_five != letter5)&&(guess_five != "quit"));
{
if (guess_five=="hint")
{
guesses - 1;
cout << theHint;
}
else
{
cout << "Oops! That's wrong!";
guesses -1;
}
cout << "\nFifth letter? ";
cin >> guess_five;
}
if (guess_five==letter5);
{
cout << "\nWell done! Next word!\n";
points + 1;
letter +1;
word + 1;
return 86;
}
}
if ((lives <= 0) || (playon='n'))
{
cout << "\n\nGAME OVER!!";
return 1;
}
}
}
}
return 0;
}
}
This is the i now have i am stuck on when compiling it i have 1 error 26 warning if anyone can look at it for me plz to see were i have gone wrong..