From 34e3c166c3aed5c4ee899502cf063199bd579fa6 Mon Sep 17 00:00:00 2001 From: fdlt3859 Date: Fri, 3 Feb 2023 21:29:19 +0000 Subject: [PATCH] Added loop to conclude the RockPprSciss game --- src/main/quizproject.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 78e4d22..d0ac11f 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -1806,12 +1806,12 @@ void v_play_rockpapersciss(){ } else if (computer_choice == PAPER) { - printf("You lose! Computer picked Paper\n"); + printf("You lose! I picked Paper\n"); computer_score++; } else { - printf("You win! Computer picked Scissors\n"); + printf("You win! I picked Scissors\n"); player_score++; } } @@ -1819,7 +1819,7 @@ void v_play_rockpapersciss(){ { if (computer_choice == ROCK) { - printf("You win! Computer picked Rock\n"); + printf("You win! I picked Rock\n"); player_score++; } else if (computer_choice == PAPER) @@ -1828,7 +1828,7 @@ void v_play_rockpapersciss(){ } else { - printf("You lose! Computer picked Scissors\n"); + printf("You lose! I picked Scissors\n"); computer_score++; } } @@ -1836,12 +1836,12 @@ void v_play_rockpapersciss(){ { if (computer_choice == ROCK) { - printf("You lose! Computer picked Rock\n"); + printf("You lose! I picked Rock\n"); computer_score++; } else if (computer_choice == PAPER) { - printf("You win! Computer picked Paper\n"); + printf("You win! I picked Paper\n"); player_score++; } else @@ -1858,7 +1858,14 @@ void v_play_rockpapersciss(){ break; } } - + if (player_score == 3) + { + printf("You win the best of three!\n"); + } + else + { + printf("I win the best of three!\n"); + } }