help?

my friend and i are working on a hangman project for our C++ class and when our professor tells us to do something it sort of comes out like gibberish. he told us that we need to concatenate one part of our code so that we can cast a character into a string so that the guess letter is turned into a string so that we can add the string garbage guess collector and the guess letter together. but the problem is we don't know how to do this. if someone could help a couple of lost girls that would be wonderful. and if you could phrase it in a way that we could actually understand that would be even better.
here is our code....:

#pragma warning(disable:4786)

#include <cstdlib> // contains clear screen
#include <fstream> // contains file stream tools
#include <iostream> // contains keyboard and monitor stream tools
#include <string> // contains string tools

using namespace std;

void Show_Welcome_Message_And_Get_Secret_Word(string&, string&);
void Mask_The_Secret_Word(string&);
void Unmasking (string&, char, int, string&);
bool Validate (string, int, char);
void Display_Current_Gallows_Picture(int);
void Get_A_Guess_Letter_And_Test_It(string, string&, int&, string&);

void Won_the_Game_Display(void);
void Show_No_Mistakes (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);

void main(void)
{
//local variables
int one=0; //to exit the game

int Mistake_Counter = 0;
bool Game_Still_Playing = true;
bool Game_Status = false;
bool result_of_validation = false;
string secretword_holding_correct_letters;
int length_of_word;
string Secret_Word = "";
string Masked_Secret_Word;
string Garbage_Guess_Collector = "";
char A_Guess_Letter;

// START //
Show_Welcome_Message_And_Get_Secret_Word(Secret_Word, Masked_Secret_Word);
Mask_The_Secret_Word(Masked_Secret_Word);

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;

cout << "Please enter guess letter" <<endl <<endl;
cin >> A_Guess_Letter;

/* determine game status */
// check if all letters are shown then you win
if(Secret_Word == Masked_Secret_Word)
{
Won_the_Game_Display();
cout << "Secret Word" <<endl <<endl;
cout << "You Won!!!" <<endl <<endl;
Game_Still_Playing = false;
}//if won

// you lost the game
else if( Mistake_Counter >= 5 )
{
cout << "Secret Word" << Secret_Word <<endl <<endl;
cout << "You Lost Sucka!!" <<endl <<endl;
//Stop the Game
Game_Still_Playing = false;

}//else if lost

// else still playing the game
else
{
// display the bad guesses made thus far in the game
cout << "Please enter guess letter" <<endl <<endl;
cin >> A_Guess_Letter;

//call validator
result_of_validation = Validate (secretword_holding_correct_letters, length_of_word, A_Guess_Letter);

if(result_of_validation == true)
{
//unmask
Unmasking (Secret_Word, A_Guess_Letter, length_of_word, Masked_Secret_Word);
}
else
{
//update lose counter
Mistake_Counter = +1;

//update garbage can ******************************************************************************************************************************
strcat(Garbage_Guess_Collector, A_Guess_Letter);]//
}

}//else you are still playing
}// end whileloop

// prompt to exit game
cout << "enter 1 to leave game: " <<endl <<endl;
cin >> one;

return; //exit to operating system
} // end main



void Show_Welcome_Message_And_Get_Secret_Word(string& Some_Secret_Word, string& m_w)
{
//local variables
/* none used */

/*start*/

// clear the screen
system("cls");

// show gallow screen
Display_Current_Gallows_Picture(0);

// show the greeting and rules
cout << "Welcome to the game!" <<endl <<endl;
cout << "The game is simple. You will be shown a word that is masked with question marks, and it will be your job to guess the letter that will reveal a letter within the mask word." <<endl <<endl;
cout << "If the letter you guessed is correct it will be revealed. If not, then you will become one step closer to losing" <<endl <<endl;

// gather the secret word
cout << "Please enter Secret Word, then press Enter" <<endl <<endl;
//put secret word into memory
m_w = Some_Secret_Word;
cin >> Some_Secret_Word;

return;
}// end procedure


void Mask_The_Secret_Word(string& m_w)
{
//local variables
int index = 0; // used to walk arrays
int length_of_word = m_w.length();
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 = length_of_word; 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
m_w[index]= '?';
}//end forloop

return;
}//end procedure


// 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 */


void Display_Current_Gallows_Picture(int mistake_counter)
{
//local variables
/* none*/

/* start */
switch(mistake_counter)
{
case 0: Show_No_Mistakes();
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;
case 6: Won_the_Game_Display();
break;
return;
}//end switch

return;
}// end procedure

//new procedure
void Get_A_Guess_Letter_And_Test_It(string secretword_holding_correct_letters, string& word_to_unmask, int& mistake_counter, string& bad_guess_container)
{
//local variables
int length_of_word = 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


// 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 = length_of_word; 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
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 = length_of_word; index++)
{
// update the mask string and the win counter for every find
if( secretword_holding_correct_letters[index] == a_guess_letter )
{
//echo how many found

}//end where found

}//end forloop
}// end if found
// else update which gallow picture must be shown as a mistake

******help in this area too??
// reset the guess letter memory storage to blank


return;
}// end procedure

Topic archived. No new replies allowed.