Modified
This commit is contained in:
parent
9932c3bede
commit
9e5490d42f
2 changed files with 19 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class Program
|
|||
switch (userSelection)
|
||||
{
|
||||
case "1. Play Lingo":
|
||||
Game attempt = new Game();
|
||||
|
||||
break;
|
||||
case "2. Quit":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue