i am having a few errors compiling a code in visual C++ with my jumble word code, can anyone help?
//word jumble
#include <iostream>
#include <string.h>
#include <cstdlib>
#include <ctime>
using namspace std;
int main()
{
enum fields{WORD, HINT, NUM_FIELDS};
const int NUM_WORDS = 5;
const string WORDS[NUM_WORDS][NUM_FIELDS] =
{
{"wall", "Do you feel you're banging agianst something?"},
{"glasses", "These might help you see the answer."},
{"labored", "Going slowly, is it?"},
{"persistent", "Keep at it."},
{"jumble", "It's what the game is all about."}
};
srand(time(0));
int choice = (rand()% NUM_WORDS);
string theWord = WORDS[choice][WORD]; //word to guess
string theHint = WORDS[choice][HINT]; //hint for word
string jumble = theWord; //jumbled version of word
int length = jumble.size();
for (int i = 0; i< length; ++i)
{
int index1 = (rand() % length);
int index2 = (rand() % length);
char temp = jumble[index2];
jumble[index1] = jumble[index2];
jumble[index2] = temp;
}
cout<<"Welcome to Word Jumble"<<endl;
cout<<"Unscramble the letters to make a word."<<endl;
cout<<"enter 'hint' for a hint."<<endl;
cout<<"enter 'quit' to quit the game."<<endl;
cout<<"the jumble is: "<<jumble;
string guess;
cout<<"your guess: ";
cin>>guess;
while((guess != theWord) &&(guess != 'quit'))
{
if (guess == 'hint')
{
cout<<theHint;
}
else
{
cout<<"sorry that is not it"<<endl;
}
cout<<"\n\nYour Guess: "<<endl;
cin>>guess;
}
if(guess == theWord)
{
cout<<"\nThat's it! You guessed it!\n"<<endl;
}
cout<<"\nthanks for playing\n";
return 0;
}