As intended when I type 1, 2, or 3, it is supposed to exit out of the loop or not enter it. But if I write something other than those 3 numbers it is supposed to loop until I type 1, 2, or 3.
But for some reason I can't get it to not enter the loop or to exit it. It doesn't matter what I type even if it is the right number to not enter the loop 1, 2, or 3. It still does enter it and loop regardless.
string userValue = Console.ReadLine();
string message = "";
Console.WriteLine("Card 1, 2, or, 3?");
Console.ReadLine();
while (userValue != "1" || userValue != "2" || userValue != "3")
{
message = "try again. Card 1, 2, or, 3?";
Console.WriteLine(message);
Console.ReadLine();
}
if (userValue == "1")
{
message = "You win a Coke";
}
else if (userValue == "2")
{
message = "You win a Diet Coke";
}
else if (userValue == "3")
{
message = "You win a Apple Juice";
}
Console.WriteLine(message);
Console.ReadLine();