const int WORD_LENGTH = 5;
static void Main(string[] args)
string Solution = "BREAD";
Console.WriteLine("Wordle clone - guess a 5 letter word!");
Console.WriteLine($"Enter your {counter} guess:");
string Guess = Console.ReadLine().ToUpper();
if(Guess.Length != WORD_LENGTH)
Console.WriteLine($"Your guess must be {WORD_LENGTH} characters long! Try again!");
Console.WriteLine("You won!");
Console.WriteLine(WordCheck(Solution, Guess));
Console.WriteLine("Please try again.");
Console.WriteLine("You lost!");
static string WordCheck(string Solution, string Guess)
char[] splitSolution = Solution.ToCharArray();
char[] splitGuess = Guess.ToCharArray();
bool[] solutionCharTaken = new bool[Solution.Length];
string[] statuses = new string[Guess.Length];
for(int i = 0; i < Guess.Length; i++)
if(Guess[i] == Solution[i])
statuses[i] = Guess[i] + " is correct!\n";
solutionCharTaken[i] = true;
for (int i = 0; i < Guess.Length; i++)
if (!String.IsNullOrEmpty(statuses[i])) continue;
if(Array.IndexOf(splitSolution,Guess[i]) == -1)
statuses[i] = Guess[i] + " is not part of the string!\n";
int indexOfPresentChar = -1;
for (int j = 0; j < splitSolution.Length; j++)
if (splitSolution[j] == Guess[i] && !solutionCharTaken[j])
if(indexOfPresentChar > -1)
statuses[i] = Guess[i] + " is part of the string but not in the correct place!\n";
solutionCharTaken[indexOfPresentChar] = true;
statuses[i] = Guess[i] + " is not part of the string!\n";
foreach (string s in statuses)