ok ive gotten this much done of hang man but im getting errors on it trying to run it could someone tell me what im doing wrong?
my code is below for you to copy and paste it to run it
// this instruction tells the program that all variables of the above libraries
// can be used.
using namespace std;
// Program Prototypes Used:
/* these four pass game status based information for running the game*/
void Show_Welcome_Message_And_Get_Secret_Word(string&);
void Mask_The_Secret_Word(string, string&);
void Display_Current_Gallows_Picture(int);
void Get_A_Guess_Letter_And_Test_It(string, string&, int&, int&, string&);
/* these update the game screen display*/
void Won_The_Game_Display(void);
void No_Mistakes_Yet(void);
void One_Mistake_Made(void);
void Two_Mistakes_Made(void);
void Three_Mistakes_Made(void);
void Four_Mistakes_Made(void);
void Five_Mistakes_Made(void);
/************************************************************************************/
/* MAIN PROGRAM SECTION */
/************************************************************************************/
void main(void)
{
//local variables
int one = 0;
int Winning_Counter = 0; // stores correct guesses during game play
int Mistake_Counter = 0; // stores mistake guesses during game play
bool Game_Still_Playing = true; // test condition for the while loop controlling game session running
bool Game_Status = false; // determines if game has been won or lost
string Secret_Word = ""; // stores word program user has to guess the letters of
string Masked_Secret_Word = ""; // stores the masked character symbols representing the secret word
string Garbage_Guess_Collector = ""; // stores the bad guesses for program user to see
// START //
Show_Welcome_Message_And_Get_Secret_Word(Secret_Word); // greet program user
Mask_The_Secret_Word(Secret_Word, Masked_Secret_Word);
// now that the program has the needed data to maintain game play, start the game
while(Game_Still_Playing)
{
// clear the screen
system("cls");
Display_Current_Gallows_Picture(Mistake_Counter);
// show the masked word stautus
cout << endl << "Masked Word Status: " << Masked_Secret_Word << endl << endl;
cout << endl << "Bad Guesses Made So Far: " << Garbage_Guess_Collector << endl << endl << endl;
/* determine game status */
// check if all letters are shown then you win
if(Secret_Word == Masked_Secret_Word)
{
Won_The_Game_Display();
cout << "You WON!!" << endl;
cout << "The secret word was: " << Secret_Word << endl;
}
// if you lost the game
else if (Mistake_Counter >= 5); && (winning_counter < static_cast <int>> secret_word_length());
{
}//else if lost
// else still playing the game
else
{
// display the bad guesses made thus far in the game
Game_Still_Playing = true;
}//else you are still playing
}// end whileloop
// prompt to exit game
cout << "enter 1 to leave game: ";
cin >> one;
return; //exit to operating system
} // end main
/************************************************************************************/
/* MAIN PROGRAM MAINTAINENCE PROCEDURE SECTION */
/************************************************************************************/
//////////////////////////////////////////////////////////////////////////////////////
//Procedure: Welcome The Program User Tool
//Purpose: To greet and inform program user about the game. It will also capture
// the secret word to mask.
//Return Thru Reference:
// - string& , the argument
//////////////////////////////////////////////////////////////////////////////////////
void Show_Welcome_Message_And_Get_Secret_Word(string& some_secret_word)
{
//local variables
/* none used */
/*start*/
// clear the screen
system("cls");
// show gallow screen
Display_Current_Gallows_Picture;
// show the greeting and rules
cout << "Welcome to the game of Hangman!" << endl;
cout << "Once a secret word is gathered, it will be displayed as a series of question marks." << endl;
cout << "Try to unmask the secret word by guessing a letter. If the guess is correct, it will be unmasked." << endl;
cout << "When you guess 5 letters that are not in the secret word, you loose!" << endl;
cout << "When you have sucesfully unmasked every letter in the secret word, you have won the game!" << endl;
// gather the secret word
cout << "Please enter a secret word, and press enter.";
cin >> some_secret_word;
return;
}// end procedure
//////////////////////////////////////////////////////////////////////////////////////
//Procedure: Masking Tool
//Purpose: To create a masked version of the secret word string, indentical in length.
//Return Thru Reference:
// - string&, argument two
//////////////////////////////////////////////////////////////////////////////////////
void Mask_The_Secret_Word(string copy_of_the_secret_word, char a_masked_version_word[], const int array_length)
{
//local variables
int secret_word_string_length = copy_of_the_secret_word.length(); // stopping condition of forloop
int index = 0; // used to walk arrays
char mask_symbol = '?'; // used as the symbols in the masked array
/* start */
// get a copy of the secret word for processing as character array
// make the masked version of the secret_word string
// it will double the size of the string
for(index = 0; index <= (array_length-1) ; index++)
{
// the insert will put all the needed masking symbols in the
// front half of the array, and leave the unmasked letters in the back half
a_masked_version_word[index] = '?';
}//end forloop
// cut the string in half, keep the front half that contains masked symbols //
/* discard the back half that holds the unmasked letters
"index" is holding where to start removing and "secret_word_string_length" is how many to remove */
index = copy_of_the_secret_word.length();
for(index; index<= (array_length-1); index ++)
{
a_masked_version_word[index] = ' ';
}
//this section will display the masked word character by character
for (index=0; index <= (array_length-1); index++)
{
cout << a_masked_version_word;
}
return;
}// end procedure
//////////////////////////////////////////////////////////////////////////////////////
//Procedure: Display Gallows Status Tool
//Purpose: To visually cue the program user of the mistaken guess status.
//Return Thru Reference:
// - none, changes monitor display
//////////////////////////////////////////////////////////////////////////////////////
void Display_Current_Gallows_Picture(int mistake_counter)
{
//local variables
/* none*/
/* start */
switch(mistake_counter)
{
case 0: No_Mistakes_Yet;
break;
case 1: One_Mistake_Made;
break;
case 2: Two_Mistakes_Made;
break;
case 3: Three_Mistakes_Made;
break;
case 4: Four_Mistakes_Made;
break;
case 5: Five_Mistakes_Made;
break;
//Shows the Picture for when you win the game
void Won_The_Game_Display(void);
{
cout << "You Won The Game!";
return;
}
// Will Show The picture at the beginning of the game
void No_Mistakes_Yet(void);
{
cout << "No Mistakes have been made.";
return;
}
//Will Show the Gallows when one mistake has been made
void One_Mistake_Made(void);
{
cout << "You have made one mistake.";
return;
}
//Will Show Gallows when two mistakes have been made
void Two_Mistakes_Made(void);
{
cout << "You have made two mistakes.";
return;
}
//Will show the Gallows when three mistakes have been made
void Three_Mistakes_Made(void);
{
cout << "You have made three mistakes.";
return;
}
//Will show gallows when four mistakes have been made
void Four_Mistakes_Made(void);
{
cout << "You have made four mistakes.";
return;
}
//Show gallows when five mistakes have been made
void Five_Mistakes_Made(void);
{
cout << "You have made five mistakes.";
return;
}
return;
}// end procedure
//////////////////////////////////////////////////////////////////////////////////////
//Procedure: Update The Masked Word Or Gallows Presentation Tool
//Purpose: To update the game status after every gues has been made.
//Return Thru Reference:
// - char, the guess, string& the masked word
//////////////////////////////////////////////////////////////////////////////////////
void Get_A_Guess_Letter_And_Test_It(string secretword_holding_correct_letters, string& word_to_unmask, int& mistake, int& win_counter, string& bad_guess_container)
{
//local variables
int array_length = secretword_holding_correct_letters.length(); // stopping condition in forloop
int index = 0; // index of forloop
bool guess_letter_was_found = false; // stores if guess letter is found
char a_guess_letter = ' ' ;
/* start */
// get a letter to guess with
cout << "Please Enter Guess Letter";
cin >> a_guess_letter;
// walk the secret word string to try and find the guess letter
// if the guess letter is found, report this
index = 0;
for(index = 0; index < array_length; index++)
{
// check current secret word letter with the guess letter
if(secretword_holding_correct_letters[index] == a_guess_letter)
{
// echo how many found
}//end if found
}//end forloop
// check if guess letter was found and try to unmask the the letters
if(guess_letter_was_found)
{
// reset data structure controlers for the next phase of processing
array_length = secretword_holding_correct_letters.length();
index = 0;
// compare the guess letter with each member of the secret word string
// when a match is found, change that value in the masked word string
// to the value of the guess letter
for(index = 0; index < array_length; index++)
{
// update the mask string and the win counter for every find
if( secretword_holding_correct_letters[index] == a_guess_letter )
{
}//end where found
}//end forloop
}// end if found
// else upadte which gallow picture must be shown as a mistake
else
{