Browse Source

Started Guessing Game

main
fdlt3859 2 years ago
parent
commit
0d70f3f99a
  1. 24
      src/main/quizproject.c
  2. 2
      src/main/quizproject.h

24
src/main/quizproject.c

@ -506,6 +506,23 @@ void play_milliongame() {
// code for game 3 goes here // 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){ void feedbackForm(void){
int rating; int rating;
char feedback[1000]; char feedback[1000];
@ -566,7 +583,8 @@ int main() {
printf("1. QuizGame\n"); printf("1. QuizGame\n");
printf("2. Fact or Lie?\n"); printf("2. Fact or Lie?\n");
printf("3. Who wants to be a millionaire\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: "); printf("Enter your choice: ");
scanf("%d", &choice); scanf("%d", &choice);
@ -584,6 +602,10 @@ int main() {
jump_to_menu = 1; jump_to_menu = 1;
break; break;
case 4: case 4:
play_guessingGame();
jump_to_menu = 1;
break;
case 5:
printf("\nThank you for trying our C code!\n"); printf("\nThank you for trying our C code!\n");
break; break;
default: default:

2
src/main/quizproject.h

@ -4,6 +4,7 @@
void play_quizgame(void); void play_quizgame(void);
void play_factorlie(void); void play_factorlie(void);
void play_milliongame(void); void play_milliongame(void);
void play_guessingGame(void);
void displayWelcomeMessage(void); void displayWelcomeMessage(void);
void displayGameInstructions(void); void displayGameInstructions(void);
void displayLifelineInstructions(void); void displayLifelineInstructions(void);
@ -24,6 +25,7 @@ void hintForHardQuestions(int);
void feedbackForm(void); void feedbackForm(void);
void displayCredits(void); void displayCredits(void);
void v_factorlie(void); void v_factorlie(void);
void v_guessingGame(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define round 3 #define round 3

Loading…
Cancel
Save