Created a full logic, trying to follow OOP principles.
This commit is contained in:
parent
a8927e4ed3
commit
dfd0d82685
5 changed files with 42 additions and 7 deletions
|
|
@ -4,17 +4,28 @@ using Spectre.Console;
|
||||||
|
|
||||||
public class PlayGame
|
public class PlayGame
|
||||||
{
|
{
|
||||||
|
public string CurrentAnswer { get; private set; }
|
||||||
|
public string CurrentBoard { get; private set; }
|
||||||
|
|
||||||
|
string Solution = ChooseWord();
|
||||||
|
public void Attempt()
|
||||||
|
{
|
||||||
|
AnsiConsole.MarkupLine($"[white on black]Enter your guess[/]");
|
||||||
|
|
||||||
|
CurrentAnswer = Console.ReadLine().Trim();
|
||||||
|
|
||||||
|
WordCorrect(CurrentAnswer);
|
||||||
|
|
||||||
|
string ToAddToBoard = WordValidation(Solution, CurrentAnswer);
|
||||||
|
|
||||||
|
CurrentBoard = CurrentBoard + ToAddToBoard(CurrentAnswer);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public PlayGame()
|
public PlayGame()
|
||||||
{
|
{
|
||||||
GameData game = new GameData();
|
GameData game = new GameData();
|
||||||
while (game.GamePlaying)
|
|
||||||
{
|
|
||||||
AnsiConsole.MarkupLine($"[white on black]Enter your guess[/]");
|
|
||||||
|
|
||||||
public string CurrentBoard = $"[white on black]Enter your guess[/]\n";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
6
Lingo/SpectreView.cs
Normal file
6
Lingo/SpectreView.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace Lingo;
|
||||||
|
|
||||||
|
public class SpectreView
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
6
Lingo/WordCorrect.cs
Normal file
6
Lingo/WordCorrect.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace Lingo;
|
||||||
|
|
||||||
|
public class WordCorrect
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
6
Lingo/WordValidation.cs
Normal file
6
Lingo/WordValidation.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace Lingo;
|
||||||
|
|
||||||
|
public class WordValidation
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
6
Lingo/WordVerification.cs
Normal file
6
Lingo/WordVerification.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace Lingo;
|
||||||
|
|
||||||
|
public class WordVerification
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue