Any one have an idea how I would output the letters that are guessed correctly from a word that I enter compared to the random word generated.
The code below outputs the length of word using underscores but I would like to replace the underscores with letters that I enter in and have been guessed correctly to it like hangman, thanks!
The code below outputs the length of word using underscores but I would like to replace the underscores with letters that I enter in and have been guessed correctly to it like hangman, thanks!
C#:
Code:
private void btnClue_Click(object sender, EventArgs e)
{
char[] a = new char[randomWord.Length];//creates new array of random word length
for (int i = 0; i < a.Length; i++)
{
a[i] = '_';
}//
for (int i = 0; i < a.Length; i++)
{
lblClue.Text += a[i].ToString() + " "; // outputs underscores for random words length
}
}