From 0d70f3f99a7708139081acedf07d1dc335f3ad7f Mon Sep 17 00:00:00 2001 From: fdlt3859 Date: Mon, 30 Jan 2023 16:22:03 +0000 Subject: [PATCH] Started Guessing Game --- src/main/quizproject.c | 24 +++++++++++++++++++++++- src/main/quizproject.h | 2 ++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index c73f24d..c5e8e60 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -506,6 +506,23 @@ void play_milliongame() { // code for game 3 goes here } +void v_guessingGame(void){ + + printf("Guess the Number!\n"); + printf("I am thinking of a number between 1 and 100. Can you guess what it is?\n"); + +} + +void play_guessingGame() { + printf("**********************\n"); + printf("Playing Guessing Game!\n"); + printf("**********************\n"); + v_guessingGame(); + printf("****************************************\n"); + printf("Thank you for playing the Guessing Game!\n"); + printf("****************************************\n"); +} + void feedbackForm(void){ int rating; char feedback[1000]; @@ -566,7 +583,8 @@ int main() { printf("1. QuizGame\n"); printf("2. Fact or Lie?\n"); printf("3. Who wants to be a millionaire\n"); - printf("4. Exit\n"); + printf("4. Guess the Number!\n"); + printf("5. Exit\n"); printf("Enter your choice: "); scanf("%d", &choice); @@ -584,6 +602,10 @@ int main() { jump_to_menu = 1; break; case 4: + play_guessingGame(); + jump_to_menu = 1; + break; + case 5: printf("\nThank you for trying our C code!\n"); break; default: diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 742ba1c..9dfb2c3 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -4,6 +4,7 @@ void play_quizgame(void); void play_factorlie(void); void play_milliongame(void); +void play_guessingGame(void); void displayWelcomeMessage(void); void displayGameInstructions(void); void displayLifelineInstructions(void); @@ -24,6 +25,7 @@ void hintForHardQuestions(int); void feedbackForm(void); void displayCredits(void); void v_factorlie(void); +void v_guessingGame(void); #define NUM_QUESTIONS 5 #define round 3