public int LettersLeft() { var left = 0; for (var i = 1; i < Word.Length - 1; ++i) { if (!Tried.Contains(Word[i])) { ++left; } } return(left); }
public int LettersAndSpacesLeft() { int left = 0; int spaces = Word.Count(Char.IsWhiteSpace); for (int i = 0; i < Word.Length; ++i) { if (!Tried.Contains(Word[i])) { left++; } } return(left - spaces); }
public void UpdateCurrentState() { var currentState = new StringBuilder(); for (var i = 0; i <= Word.Length - 1; i++) { if (Tried.Contains(Word[i])) { currentState.Append($" {Word[i]} "); } else { currentState.Append(" _ "); } } CurrentState = currentState.ToString(); }
public void UpdateCurrentState() { var currentState = new StringBuilder(); currentState.Append($"{Word[0]} "); for (var i = 1; i < Word.Length - 1; ++i) { if (Tried.Contains(Word[i])) { currentState.Append($"{Word[i]} "); } else { currentState.Append("_ "); } } currentState.Append(Word[Word.Length - 1]); this.CurrentState = currentState.ToString(); }