diff --git a/.idea/.idea.Lingo/.idea/.gitignore b/.idea/.idea.Lingo/.idea/.gitignore deleted file mode 100644 index f59801f..0000000 --- a/.idea/.idea.Lingo/.idea/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Rider ignored files -/contentModel.xml -/.idea.Lingo.iml -/modules.xml -/projectSettingsUpdater.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Ignored default folder with query files -/queries/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/.idea.Lingo/.idea/encodings.xml b/.idea/.idea.Lingo/.idea/encodings.xml deleted file mode 100644 index df87cf9..0000000 --- a/.idea/.idea.Lingo/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/.idea.Lingo/.idea/indexLayout.xml b/.idea/.idea.Lingo/.idea/indexLayout.xml deleted file mode 100644 index 7b08163..0000000 --- a/.idea/.idea.Lingo/.idea/indexLayout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/.idea.Lingo/.idea/vcs.xml b/.idea/.idea.Lingo/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/.idea.Lingo/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Lingo/Game.cs b/Lingo/Game.cs index 9cb0eb9..db08bdc 100644 --- a/Lingo/Game.cs +++ b/Lingo/Game.cs @@ -1,46 +1,56 @@ -using System.Reflection.Metadata.Ecma335; -using System.Security.Cryptography; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices.JavaScript; using Spectre.Console; + namespace Lingo; public class Game { - private int count = 0; static Random rnd = new Random(); - private static int index = rnd.Next(1, Words.FiveLetterWords.Count); - private static string solution = Words.FiveLetterWords[index]; - private static bool exit = false; - public void validateFiveLetters(string solution) + 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 (exit == false) + while (solution.Length != 5) { - if (solution.Length != 5) - { - index = rnd.Next(1, Words.FiveLetterWords.Count); - } - else - { - exit = true; - } + unit = rnd.Next(1, Words.FiveLetterWords.Count); + solution = Words.FiveLetterWords[unit]; } } - private List attemptList; + private string lineOne = ""; + private string lineTwo = ""; + private string lineThree = ""; + private string lineFour = ""; + private string lineFive = ""; - private void createCharList(string solution) + public void GameTurn() { - foreach (char c in solution) - { - attemptList.Add(c); - } + AnsiConsole.MarkupLine($"[blue]Attempt #{Tries}[/]"); + Console.ReadLine(); + + //Don't forget, we need big logic here! } - - + public Game() { - validateFiveLetters(solution); - createCharList(solution); - + if (trying.Length == 5) + { + Game game = new Game(); + while (game.Tries <= 5) + { + AnsiConsole.MarkupLine($"Attempt #{Tries}"); + game.GameTurn(); + } + } + else + { + AnsiConsole.MarkupLine($"[red]Please enter a try that has 5 letters only![/]"); + } } } \ No newline at end of file diff --git a/Lingo/Play.cs b/Lingo/Play.cs deleted file mode 100644 index af8a332..0000000 --- a/Lingo/Play.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Lingo; - -public class Play -{ - public Play() - { - - } - - public int I { get; private set; } -} \ No newline at end of file