Compare commits

..

No commits in common. "e2bcf46be73d7990940f0eff1e37e8ff466c8ce7" and "9e5490d42f3f6e67691eed2326803a41e0874d55" have entirely different histories.

6 changed files with 38 additions and 72 deletions

15
.idea/.idea.Lingo/.idea/.gitignore generated vendored
View file

@ -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

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -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<char> 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![/]");
}
}
}

View file

@ -1,11 +0,0 @@
namespace Lingo;
public class Play
{
public Play()
{
}
public int I { get; private set; }
}