Player 1, enter r for rock, p for paper, or s for scissors Player 2, enter r for rock, p for paper, or s for scissors Player 1 picked rock Player 2 picked scissors rock crushes scissors, player 1 wins
Player 1, enter r for rock, p for paper, or s for scissors Player 2, enter r forr rock, p for paper, or s for scissors Player 1 picked scissors Player 2 picked paper scissors cut paper, player 1 wins
Player 1 has 3 points, player 2 has 0 point, Player 1 is the winner!
Goodbye!
_______________________________________________
Supposed to use char GetChoice Function NOTE: a "GetChoice" function has been supplied to handle the // problem of obtaining a user's choice without showing // the input on the screen. This function also handles // the error message if the user enters an invalid choice char GetChoice() // This has been supplied to handle the problem of obtaining a user's choice // without showing the input on the screen. This function also handles // the error message if the user enters an invalid choice. { char choice; system("stty -echo"); cin >> choice; system("stty echo"); if ((choice == 'r') || (choice == 's') || (choice == 'p')) return choice; else { cout << "ERROR: " << choice << " is not a valid choice, please try again" << endl; return GetChoice(); }