- @foreach(var guess in PreviousGuesses)
+ @foreach (CharData[] guess in _previousGuesses)
{
- @for(int i = 0; i < ColumnCount; i++)
+ @foreach (CharData cd in guess)
{
- char guessedChar = char.ToUpper(guess[i]);
-
- if(guessedChar == char.ToUpper(Secret[i]))
+ if (cd.State == CharState.Correct)
{
- @guessedChar
+ @cd.Char
}
- else if (Secret.Contains(guessedChar, StringComparison.InvariantCultureIgnoreCase))
+ else if (cd.State == CharState.Misplaced)
{
- @guessedChar
+ @cd.Char
}
else
{
- @guessedChar
+ @cd.Char
}
}
@@ -48,99 +58,178 @@