Question: For some reason when creating this rock, paper, scissors program, no matter what I input the computer always chooses paper. And the results of the



For some reason when creating this rock, paper, scissors program, no matter what I input the computer always chooses paper. And the results of the game are always "You Tied" even when it is clear that the user has beaten the computer. Is there any way to fix this?
int main (void) int numMatches; I number of matches that will be played / int roundMatch; II current round number that is being played int compChoice; // the choice of "rock, paper, or scissors that the computer will make // char userChoice; // the choice of "rock, paper, or scissors that the user will make // int R; // rock int P; I/ paper11 int S; 1/ scissors 11 printf("Starting the CPSC 1011 Rock, Paper, Scissors Game!n"); printf("Enter the number of matches to play:") scanf(" %d", &nunMa tches); numMatches nunMatches + 1; compChoice- (rand() % 3) ;; // to 2 // P-1; for (roundMatch# 1; roundMatch
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
