From 67ac9d68c54426e1eec024c457661a4a1ad7b7f9 Mon Sep 17 00:00:00 2001 From: Jocelyn Date: Fri, 29 May 2026 19:18:31 -0300 Subject: [PATCH] Initial --- .gitignore | 5 +++++ Lingo.sln | 16 ++++++++++++++++ Lingo/Game.cs | 25 +++++++++++++++++++++++++ Lingo/Lingo.csproj | 14 ++++++++++++++ Lingo/Program.cs | 45 +++++++++++++++++++++++++++++++++++++++++++++ Lingo/Words.cs | 17 +++++++++++++++++ 6 files changed, 122 insertions(+) create mode 100644 .gitignore create mode 100644 Lingo.sln create mode 100644 Lingo/Game.cs create mode 100644 Lingo/Lingo.csproj create mode 100644 Lingo/Program.cs create mode 100644 Lingo/Words.cs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/Lingo.sln b/Lingo.sln new file mode 100644 index 0000000..5e97e08 --- /dev/null +++ b/Lingo.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lingo", "Lingo\Lingo.csproj", "{7C55B2BF-A35B-408C-A143-09E9C8D3F24F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7C55B2BF-A35B-408C-A143-09E9C8D3F24F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C55B2BF-A35B-408C-A143-09E9C8D3F24F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C55B2BF-A35B-408C-A143-09E9C8D3F24F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C55B2BF-A35B-408C-A143-09E9C8D3F24F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Lingo/Game.cs b/Lingo/Game.cs new file mode 100644 index 0000000..1e65d9d --- /dev/null +++ b/Lingo/Game.cs @@ -0,0 +1,25 @@ +namespace Lingo; + +public abstract class Game +{ + public string Solution { get; } + public int AttemptsRemaining { get; protected set; } + public List Guesses { get; protected set; } = new(); + public bool IsWon { get; protected set; } + public bool IsLost { get; protected set; } + + public abstract string EvaluateGuess(string guess); + + public virtual bool MakeGuess(string guess) + { + return true; + } +} + +public class LingoGame : Game +{ + public override string EvaluateGuess(string guess) + { + return guess; + } +} \ No newline at end of file diff --git a/Lingo/Lingo.csproj b/Lingo/Lingo.csproj new file mode 100644 index 0000000..073bd2e --- /dev/null +++ b/Lingo/Lingo.csproj @@ -0,0 +1,14 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + diff --git a/Lingo/Program.cs b/Lingo/Program.cs new file mode 100644 index 0000000..3d3667d --- /dev/null +++ b/Lingo/Program.cs @@ -0,0 +1,45 @@ +namespace Lingo; + +using Spectre.Console; + +class Program +{ + static void Main(string[] args) + { + try + { + bool isRunning = true; + + do + { + AnsiConsole.Clear(); + + string userSelection = AnsiConsole.Prompt( + new SelectionPrompt() + .Title("Choose play or quit ") + .AddChoices + ( + "1. Play Lingo", + "2. Quit" + ) + ); + switch (userSelection) + { + case "1. Play Lingo": + Console.WriteLine("Let's go! Press Any Key To Continue"); + Console.ReadLine(); + break; + case "2. Quit": + isRunning = false; + break; + } + //This is where the Switch will be. + } while (isRunning); + } + catch (Exception ex) + { + AnsiConsole.MarkupLine($"[red]Error:[/] {ex.Message}"); + Console.ReadLine(); + } + } +} \ No newline at end of file diff --git a/Lingo/Words.cs b/Lingo/Words.cs new file mode 100644 index 0000000..4696d73 --- /dev/null +++ b/Lingo/Words.cs @@ -0,0 +1,17 @@ +namespace Lingo; + +public static class Words +{ + public static readonly List CommonFiveLetterWords = new List + { + "about", "above", "actor", "adult", "after", "again", "agent", "agree", "ahead", "alarm", "album", "alert", + "alike", "alive", "allow", "alone", "along", "alter", "among", "anger", "angle", "angry", "apart", "apple", + "apply", "arena", "argue", "arise", "array", "arrow", "aside", "asset", "audio", "audit", "avoid", "award", + "aware", "awful", "badly", "baker", "basic", "basis", "beach", "beard", "beast", "begin", "being", "below", + "bench", "berry", "birth", "black", "blade", "blame", "blind", "block", "blood", "board", "boast", "bonus", + "boost", "bound", "brain", "brand", "brave", "bread", "break", "breed", "brick", "bride", "brief", "bring", + "broad", "broke", "brown", "brush", "buyer", "cabin", "cable", "camel", "canal", "candy", "cards", "carry", + "cases", "catch", "cause", "chair", "chart", "chase", "cheap", "cheat", "check", "cheek", "cheer", "chess", + "chest" + }; +} \ No newline at end of file