Added the Game Loop

This commit is contained in:
Jocelyn 2026-08-02 15:24:27 -03:00
commit 0f7d9022c4
2 changed files with 27 additions and 3 deletions

24
Lingo/GameLoop.cs Normal file
View file

@ -0,0 +1,24 @@
namespace Lingo;
public class GameLoop
{
public string SelectedWord {
get
{
return Setup.wordSelector();
}
private set;
}
public string InputWord {
get
{
return Setup.inputWord();
}
private set;
}
public GameLoop()
{
}
}

View file

@ -4,15 +4,15 @@ public static class Setup
{ {
static Random rnd = new Random(); static Random rnd = new Random();
static string[] words = File.ReadAllLines("words.txt"); static string[] words = File.ReadAllLines("words.txt");
static string wordSelector() public static string wordSelector()
{ {
int rand = rnd.Next(0, words.Length); int rand = rnd.Next(0, words.Length);
string selectedWord = words[rand]; string selectedWord = words[rand];
return selectedWord; return selectedWord;
} }
static string inputWord() public static string inputWord()
{ {
string inputWord = Console.ReadLine(); string inputWord = Console.ReadLine();
return inputWord; return inputWord;