Browse Source

Added loop to conclude the RockPprSciss game

main
fdlt3859 2 years ago
parent
commit
34e3c166c3
  1. 21
      src/main/quizproject.c

21
src/main/quizproject.c

@ -1806,12 +1806,12 @@ void v_play_rockpapersciss(){
} }
else if (computer_choice == PAPER) else if (computer_choice == PAPER)
{ {
printf("You lose! Computer picked Paper\n");
printf("You lose! I picked Paper\n");
computer_score++; computer_score++;
} }
else else
{ {
printf("You win! Computer picked Scissors\n");
printf("You win! I picked Scissors\n");
player_score++; player_score++;
} }
} }
@ -1819,7 +1819,7 @@ void v_play_rockpapersciss(){
{ {
if (computer_choice == ROCK) if (computer_choice == ROCK)
{ {
printf("You win! Computer picked Rock\n");
printf("You win! I picked Rock\n");
player_score++; player_score++;
} }
else if (computer_choice == PAPER) else if (computer_choice == PAPER)
@ -1828,7 +1828,7 @@ void v_play_rockpapersciss(){
} }
else else
{ {
printf("You lose! Computer picked Scissors\n");
printf("You lose! I picked Scissors\n");
computer_score++; computer_score++;
} }
} }
@ -1836,12 +1836,12 @@ void v_play_rockpapersciss(){
{ {
if (computer_choice == ROCK) if (computer_choice == ROCK)
{ {
printf("You lose! Computer picked Rock\n");
printf("You lose! I picked Rock\n");
computer_score++; computer_score++;
} }
else if (computer_choice == PAPER) else if (computer_choice == PAPER)
{ {
printf("You win! Computer picked Paper\n");
printf("You win! I picked Paper\n");
player_score++; player_score++;
} }
else else
@ -1858,7 +1858,14 @@ void v_play_rockpapersciss(){
break; break;
} }
} }
if (player_score == 3)
{
printf("You win the best of three!\n");
}
else
{
printf("I win the best of three!\n");
}
} }

Loading…
Cancel
Save