|
|
@ -2269,6 +2269,31 @@ void b_basketballQuiz() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//Guess the birth year |
|
|
|
|
|
|
|
void b_guessbirthyear() |
|
|
|
{ |
|
|
|
int year = 1961; |
|
|
|
int guess; |
|
|
|
int tries = 0; |
|
|
|
|
|
|
|
printf("Guess the year Barack Obama was born: "); |
|
|
|
scanf("%d", &guess); |
|
|
|
|
|
|
|
while (guess != year) { |
|
|
|
if (guess < year) { |
|
|
|
printf("Too low. Guess again: "); |
|
|
|
} else if (guess > year) { |
|
|
|
printf("Too high. Guess again: "); |
|
|
|
} |
|
|
|
|
|
|
|
scanf("%d", &guess); |
|
|
|
tries++; |
|
|
|
} |
|
|
|
|
|
|
|
printf("Correct! It took you %d tries to guess the year.\n", tries); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void v_play_rockpapersciss(){ |
|
|
@ -2744,7 +2769,8 @@ int main(int argc, char *argv[]) { |
|
|
|
printf("11. Play Geography Quiz!\n"); |
|
|
|
printf("12. Mini-Game: Guess the animal!\n"); |
|
|
|
printf("13. Basketball Quiz!\n"); |
|
|
|
printf("14. Exit\n"); |
|
|
|
printf("14. Guess Barack Obama's birth Year!\n"); |
|
|
|
printf("15. Exit\n"); |
|
|
|
printf("Enter your choice: "); |
|
|
|
scanf("%d", &choice); |
|
|
|
v_progress_bar(argc,argv); |
|
|
@ -2803,6 +2829,10 @@ int main(int argc, char *argv[]) { |
|
|
|
jump_to_menu = 1; |
|
|
|
break; |
|
|
|
case 14: |
|
|
|
b_guessbirthyear(); |
|
|
|
jump_to_menu = 1; |
|
|
|
break; |
|
|
|
case 15: |
|
|
|
printf("\nThank you for trying our C code!\n"); |
|
|
|
break; |
|
|
|
default: |
|
|
|