From 9e5490d42f3f6e67691eed2326803a41e0874d55 Mon Sep 17 00:00:00 2001 From: Jocelyn Hebert Date: Tue, 2 Jun 2026 16:15:23 -0300 Subject: [PATCH] Modified --- Lingo/Game.cs | 37 ++++++++++++++++++------------------- Lingo/Program.cs | 1 + 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Lingo/Game.cs b/Lingo/Game.cs index 00786e8..db08bdc 100644 --- a/Lingo/Game.cs +++ b/Lingo/Game.cs @@ -4,49 +4,48 @@ using Spectre.Console; namespace Lingo; -public class Attempt +public class Game { static Random rnd = new Random(); public int Tries { get; private set; } - + private static int unit = rnd.Next(1, Words.FiveLetterWords.Count); public string Solution = Words.FiveLetterWords[unit]; - + public string trying; - + private void catchingLengthErrors(string solution) { - while (solution.Length != 5) + while (solution.Length != 5) { unit = rnd.Next(1, Words.FiveLetterWords.Count); solution = Words.FiveLetterWords[unit]; } } - - public string lineOne = ""; - public string lineTwo = ""; - public string lineThree = ""; - public string lineFour = ""; - public string lineFive = ""; - + + private string lineOne = ""; + private string lineTwo = ""; + private string lineThree = ""; + private string lineFour = ""; + private string lineFive = ""; + public void GameTurn() { AnsiConsole.MarkupLine($"[blue]Attempt #{Tries}[/]"); Console.ReadLine(); - - //Don't forget, we need big logicc here! + + //Don't forget, we need big logic here! } - public Attempt() + public Game() { - if (trying.Length == 5) { - Attempt attempt = new Attempt(); - while (attempt.Tries <= 5) + Game game = new Game(); + while (game.Tries <= 5) { AnsiConsole.MarkupLine($"Attempt #{Tries}"); - attempt.GameTurn(); + game.GameTurn(); } } else diff --git a/Lingo/Program.cs b/Lingo/Program.cs index 332ff01..265bc43 100644 --- a/Lingo/Program.cs +++ b/Lingo/Program.cs @@ -26,6 +26,7 @@ class Program switch (userSelection) { case "1. Play Lingo": + Game attempt = new Game(); break; case "2. Quit":