C#C
C#3y ago
Liunesca

❔ How do I make it so when the player makes an incorrect key input, it lets them make another input

if (keyInfo.Key == ConsoleKey.D1)
{
Console.WriteLine("This is a test!");
}

else if (keyInfo.Key == ConsoleKey.D2)
{
Console.WriteLine("This is also a test!");
}

else if (keyInfo.Key == ConsoleKey.D3)
{
Console.WriteLine();
}

else if (keyInfo.Key == ConsoleKey.D4)
{
Console.WriteLine();
}

else
{
Console.WriteLine("Please press the correct key.");
}

Console.ReadLine();
Was this page helpful?