public void Start() { string[] words = ReadWords(); string lingoWord = ChooseWord(words); LingoGameLogic lingoGame = new LingoGameLogic(); lingoGame.SetLingoWord(lingoWord); PlayLingo(lingoGame); }
public void PlayLingo(LingoGameLogic lingoGame) { int attemptsLeft = 5; int wordLength = lingoGame.lingoWord.Length; lingoGame.CheckWord(Console.ReadLine()); while (attemptsLeft > 0 && !lingoGame.GuessedWord()) { lingoGame.playerWord = ReadPlayerWord(wordLength); attemptsLeft--; DisplayResults(lingoGame); } }
public void DisplayResults(LingoGameLogic lingoGame) { for (int i = 0; i < lingoGame.playerWord.Length - 1; i++) { if (lingoGame.letterResults[i] == LetterStateEnum.Correct) { Console.BackgroundColor = ConsoleColor.DarkGreen; } else if (lingoGame.letterResults[i] == LetterStateEnum.WrongPosition) { Console.BackgroundColor = ConsoleColor.DarkYellow; } Console.Write(lingoGame.playerWord[i]); Console.ResetColor(); } }