I'm writing a program for a game of Rock, Paper, Scissors.
I've written it and it works and now I'm doing the extra credit for it which is
Adding validating input from the user (if the user enters a "K" or "k", you would ask the user again until he/she enters only P/p/s/S/R/s)
I know it might seem simple but I've been trying different things and haven't been able to make it work without actually messing up the program so help please?
Okay so when I put in two wrong inputs like g and y it works it says invalid input try again but if I put in the right inputs like r and p it gives the results of who wins but right after it still says invalid input
and putting the continue; never allows it to be asked "Do you want to continue?"
It seems to run perfectly for me. If the user enters an invalid input, it's only correct to say that nobody wins. The program immediately asks for more input. This is a neat and professional way to handle such a situation.
The only reason this code would be unsatisfactory is if it was part of an assignment and you had to give a specific output.
Did you try putting the valid inputs? When player 1 enters p and player 2 enters r the result is paper covers rock player 1 wins but the next line after is still invalid input try again and then goes back to asking the user "Make your choice player one"
With the valid inputs I need it to go back to asking "Do you want to continue " instead of automatically restarting the loop.