public bool MakeGuess(string word) { if (word == null) { throw new ArgumentNullException(); } GameOver = true; gameStep = 6; return(GameResult = WordToGuess.ToString() == word); }
public bool MakeGuess(char letter) { if (GuessedLetters.Contains(letter)) { if (++gameStep > 6) { GameOver = true; GameResult = false; return(false); } } if (WordToGuess.ToString().Contains(letter)) { GuessedLetters.Add(letter); if (MaskedWord() == WordToGuess.ToString()) { GameOver = true; GameResult = true; } return(true); } else { if (++gameStep > 6) { GameOver = true; GameResult = false; return(false); } } return(false); }
//will print the (Coded) Word public override string ToString() { return(WordToGuess.ToString()); }