Выводиться рандомная буква -> печатаете эту букву -> count++, если нет, то count = 0. Но после ввода правильной буквы, count присваивается 0 почему? Вроде бы должно работать.
static void EngTest(){
Console.Clear();
char[] eng = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
Random random = new Random();
int count = 5;
int max = 0;
while (true){
Console.Clear();
Console.WriteLine(count);
string word = Convert.ToString(eng[random.Next(0, eng.Length)]);
Console.WriteLine(word);
if (Console.ReadKey().Key != ConsoleKey.Escape){
string wordTyped = Console.ReadLine();
if (String.Equals(wordTyped, word) == true){
count++;
if (max <= count){
max = count;
}
}
else{
count = 0;
}
}
else{
Console.WriteLine($"aCount: {count}\nMax wins: {max}");
break;
}
}
}
Ошибка кроется, как мне кажется в этих строках.
if (Console.ReadKey().Key != ConsoleKey.Escape){
string wordTyped = Console.ReadLine();
if (String.Equals(wordTyped, word) == true){
count++;