Progress made May 31
This commit is contained in:
parent
67ac9d68c5
commit
9932c3bede
3 changed files with 90 additions and 27 deletions
|
|
@ -1,25 +1,57 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices.JavaScript;
|
||||
using Spectre.Console;
|
||||
|
||||
namespace Lingo;
|
||||
|
||||
public abstract class Game
|
||||
public class Attempt
|
||||
{
|
||||
public string Solution { get; }
|
||||
public int AttemptsRemaining { get; protected set; }
|
||||
public List<string> Guesses { get; protected set; } = new();
|
||||
public bool IsWon { get; protected set; }
|
||||
public bool IsLost { get; protected set; }
|
||||
static Random rnd = new Random();
|
||||
public int Tries { get; private set; }
|
||||
|
||||
public abstract string EvaluateGuess(string guess);
|
||||
private static int unit = rnd.Next(1, Words.FiveLetterWords.Count);
|
||||
public string Solution = Words.FiveLetterWords[unit];
|
||||
|
||||
public virtual bool MakeGuess(string guess)
|
||||
public string trying;
|
||||
|
||||
private void catchingLengthErrors(string solution)
|
||||
{
|
||||
return true;
|
||||
while (solution.Length != 5)
|
||||
{
|
||||
unit = rnd.Next(1, Words.FiveLetterWords.Count);
|
||||
solution = Words.FiveLetterWords[unit];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LingoGame : Game
|
||||
{
|
||||
public override string EvaluateGuess(string guess)
|
||||
|
||||
public string lineOne = "";
|
||||
public string lineTwo = "";
|
||||
public string lineThree = "";
|
||||
public string lineFour = "";
|
||||
public string lineFive = "";
|
||||
|
||||
public void GameTurn()
|
||||
{
|
||||
return guess;
|
||||
AnsiConsole.MarkupLine($"[blue]Attempt #{Tries}[/]");
|
||||
Console.ReadLine();
|
||||
|
||||
//Don't forget, we need big logicc here!
|
||||
}
|
||||
|
||||
public Attempt()
|
||||
{
|
||||
|
||||
if (trying.Length == 5)
|
||||
{
|
||||
Attempt attempt = new Attempt();
|
||||
while (attempt.Tries <= 5)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"Attempt #{Tries}");
|
||||
attempt.GameTurn();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[red]Please enter a try that has 5 letters only![/]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26,14 +26,12 @@ class Program
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -2,16 +2,49 @@ namespace Lingo;
|
|||
|
||||
public static class Words
|
||||
{
|
||||
public static readonly List<string> CommonFiveLetterWords = new List<string>
|
||||
public static readonly List<string> FiveLetterWords = new List<string>
|
||||
{
|
||||
"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"
|
||||
"joust", "swamp", "glint", "prawn", "chide", "stomp", "fleck", "groan",
|
||||
"birch", "thrum", "slunk", "brave", "chops", "twirl", "plank", "snore", "draft", "gloom", "wharf", "spunk",
|
||||
"cling", "broth", "flint", "grove", "scamp", "dwarf", "prism", "cleft", "stoic", "blurt", "frisk", "swoon",
|
||||
"grasp", "tryst", "chomp", "pleat", "sniff", "glare", "whelp", "sprig", "clamp", "brood", "floss", "gripe",
|
||||
"scalp", "stunt", "bliss", "crisp", "joust", "swamp", "glint", "prawn", "chide", "stomp", "fleck", "groan",
|
||||
"birch", "thrum", "slunk", "brave", "chops", "twirl", "plank", "snore", "draft", "gloom", "wharf", "spunk",
|
||||
"cling", "broth", "flint", "grove", "scamp", "dwarf", "prism", "cleft", "stoic", "blurt", "frisk", "swoon",
|
||||
"grasp", "tryst", "chomp", "pleat", "glyph", "tramp", "swirl", "clunk", "broil", "flare", "gruff", "snout",
|
||||
"plods", "chimp", "straw", "blond", "crimp", "joust", "whelk", "sprat", "clasp", "brunt", "flunk", "graze",
|
||||
"stomp", "bloke", "crest", "jumpy", "swath", "glean", "prowl", "chasm", "thong", "slant", "brawl", "chomp",
|
||||
"tweed", "plumb", "snare", "drool", "gloat", "whirl", "spiel", "clove", "brisk", "flown", "grout", "scald",
|
||||
"stoop", "blunt", "croak", "jilts", "swipe", "gleam", "prong", "chewy", "throb", "slump", "brawn", "clops",
|
||||
"twist", "pluck", "snuck", "droop", "glove", "wring", "spout", "clown", "brood", "fleck", "growl", "scalp",
|
||||
"stoic", "blaze", "creed", "joker", "swung", "glide", "prude", "churn", "thump", "slung", "brine", "cleft",
|
||||
"twins", "plume", "snide", "dross", "gloss", "wrung", "spree", "cluck", "brook", "flout", "gruel", "scoff",
|
||||
"stomp", "blown", "crept", "julep", "swore", "glint", "prawn", "chunk", "thwart", "slosh", "graft", "twang",
|
||||
"swoop", "clamp", "broil", "flank", "grubs", "snobs", "plonk", "chive", "strep", "bland", "crisp", "jowls",
|
||||
"whelp", "sprat", "clasp", "brunt", "flunk", "graze", "stalk", "bloke", "crest", "jumps", "swath", "glean",
|
||||
"prowl", "chasm", "thong", "slant", "brawl", "chomp", "tweed", "plumb", "snare", "drool", "gloat", "whirl",
|
||||
"spiel", "clove", "brisk", "flown", "grout", "scald", "stoop", "blunt", "croak", "jilts", "swipe", "gleam",
|
||||
"prong", "chewy", "throb", "slump", "brawn", "clops", "twist", "pluck", "snuck", "droop", "glove", "wring",
|
||||
"spout", "clown", "broom", "fleck", "growl", "scalp", "stoic", "blaze", "creed", "joker", "swung", "glide",
|
||||
"prude", "churn", "thump", "slung", "brine", "cleft", "twins", "plume", "snide", "dross", "gloss", "wrung",
|
||||
"spree", "cluck", "brook", "flout", "gruel", "scoff", "stomp", "blown", "crept", "julep", "swore", "glint",
|
||||
"prawn", "chunk", "slash", "slosh", "gavel", "twirl", "swank", "clunk", "braid", "flare", "gruff", "snout",
|
||||
"plods", "chimp", "straw", "blond", "crimp", "joust", "whelk", "sprig", "grasp", "brunt", "flunk", "graze",
|
||||
"stomp", "bloke", "crest", "jumpy", "swath", "gleam", "prowl", "chasm", "thong", "slant", "brawl", "chomp",
|
||||
"tweed", "plumb", "snare", "drool", "gloat", "whirl", "spiel", "clove", "brisk", "flown", "grout", "scald",
|
||||
"stoop", "blunt", "croak", "jilts", "swipe", "gleam", "prong", "chewy", "throb", "slump", "brawn", "clops",
|
||||
"twist", "pluck", "snuck", "droop", "glove", "wring", "spout", "clown", "brood", "fleck", "growl", "scalp",
|
||||
"stoic", "blaze", "creed", "joker", "swung", "glide", "prude", "churn", "thump", "slung", "brine", "cleft",
|
||||
"twins", "plume", "snide", "dross", "gloss", "wrung", "spree", "cluck", "brook", "flout", "gruel", "scoff",
|
||||
"stomp", "blown", "crept", "julep", "swore", "glint", "prawn", "chunk", "thwat", "slosh", "graft", "tramp",
|
||||
"swoop", "clamp", "broil", "flank", "grubs", "snobs", "plonk", "chive", "strep", "bland", "crisp", "jowls",
|
||||
"whelp", "sprat", "clasp", "brunt", "flunk", "graze", "stalk", "bloke", "crest", "jumps", "swath", "glean",
|
||||
"prowl", "chasm", "thong", "slant", "brawl", "chomp", "tweed", "plumb", "snare", "drool", "gloat", "whirl",
|
||||
"spiel", "clove", "brisk", "flown", "grout", "scald", "stoop", "blunt", "croak", "jilts", "swipe", "gleam",
|
||||
"prong", "chewy", "throb", "slump", "brawn", "clops", "twist", "pluck", "snuck", "droop", "glove", "wring",
|
||||
"spout", "clown", "broom", "fleck", "growl", "scalp", "stoic", "blaze", "creed", "joker", "swung", "glide",
|
||||
"prude", "churn", "thump", "slung", "brine", "cleft", "twins", "plume", "snide", "dross", "gloss", "wrung",
|
||||
"spree", "cluck", "brook", "flout", "gruel", "scoff", "stomp", "blown", "crept", "julep", "swore", "glint",
|
||||
"prawn", "chunk", "slash", "slosh"
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue