Hi All!
I’m making a hangman game for a uni project. I’m storing the characters of the word & the characters guessed in list. When I print the list I’m printing it to a string. when the string prints the the letter is wrong I add a space however instead of the string just having 1 space it seems to be added 4 or more.
can somebody help me with this URGENTLY
public void SetCharUI() {
WrongL = "";
Debug.Log(GuessedWrong.Count);
for (int i = 0; i < GuessedWrong.Count; i++) {
WrongL += GuessedWrong[i] + " ";
}
GuessedWord = "";
for (int j = 0; j < Characters.Count; j++) {
string c = Characters[j].ToString();
for (int n = 0; n < GuessedCorrect.Count; n++) {
string a = GuessedCorrect[n].ToString();
if (c == a) {
GuessedWord += c;
} else {
GuessedWord += " ";
}
}
}
DisplayedWord.text = GuessedWord;
WrongLetters.text = WrongL;
}