I'm writing a program for a simple game of Odds and Evens, but I can't seem to figure out what's wrong with my while loop.
Game rules: https://en.wikipedia.org/wiki/Odds_and_evens_(hand_game)
It's meant to make it so that while the user doesn't enter either odds, Odds, evens, or Evens an alert comes up saying 'Please enter either odds or evens'.
But, whenever I run the code, it just turns into an infinite loop, repeating the alert, no matter what I put in. Even if it is the correct response I want.
var oddEven = prompt('Would you like to be odds or evens?', 'Odds')
while (oddEven != 'odds' || oddEven != 'Odds' || oddEven != 'evens' || oddEven != 'Evens') {
oddEven = prompt('Please enter either odds or evens');
}
I am very new to programming and just started learning a couple months ago so any advice would be appreciated.
Thanks for the help :)