If you enter "PAPER", then playerMove != "SCISSORS"
is true, so your while-condition is true, because only one part of a logical OR has to be true.
You want all of the !="XYZ"
to be true, OR the string to be empty:
while((playerMove != "SCISSORS" && playerMove != "PAPER" && playerMove != "ROCK") || string.IsNullOrEmpty(playerMove))
That said, there are probably easier ways to check this.
You could define a list of acceptable strings, for instance, and check against that:
using System.Linq;
...
var acceptedString = new List<string> {"ROCK", "PAPER", "SCISSORS"};
...
while (!acceptedStrings.Contains(playermove)
{
// error message
}
Actually checking for an empty string is useless, since an empty string never has an accepted value.
Another option, as mentioned in a comment, is to extract your condition to a method. This is almost always a good idea for complicated conditions:
while (!IsValid(playermove)){...}
...
private static bool IsValid(string move)
{
return move == "ROCK"
|| move == "PAPER"
|| move == "SCISSORS";
}
Alternatively you can rewrite that to
while (!IsValid(playermove)){...}
...
private static bool IsValid(string move) =>
move == "ROCK" || move == "PAPER" || move == "SCISSORS";