Browse Source

Added Guess the celebrity game and headers

main
fdlt3885 2 years ago
parent
commit
c3d04ea59e
  1. 55
      src/main/quizproject.c
  2. 5
      src/main/quizproject.h

55
src/main/quizproject.c

@ -2787,6 +2787,50 @@ void b_personality() {
}
//Guess the celebrity
void b_celebrity(){
char name[20];
printf("Think of a celebrity and I will try to guess who it is.\n");
strcpy(celebrity, "Justin Bieber");
printf("Is it %s? (y/n)\n", celebrity);
scanf(" %c", &answer);
if (tolower(answer) == 'y') {
printf("I got it! It's %s\n", celebrity);
}
strcpy(celebrity, "Taylor Swift");
printf("Is it %s? (y/n)\n", celebrity);
scanf(" %c", &answer);
if (tolower(answer) == 'y') {
printf("I got it! It's %s\n", celebrity);
}
strcpy(celebrity, "Kanye West");
printf("Is it %s? (y/n)\n", celebrity);
scanf(" %c", &answer);
if (tolower(answer) == 'y') {
printf("I got it! It's %s\n", celebrity);
}
strcpy(celebrity, "Dwayne Johnson");
printf("Is it %s? (y/n)\n", celebrity);
scanf(" %c", &answer);
if (tolower(answer) == 'y') {
printf("I got it! It's %s\n", celebrity);
}
printf("I give up. Who were you thinking of?\n");
scanf("%s", name);
printf("Ah, yes! %s is a great celebrity.\n", name);
}
void v_play_rockpapersciss(){
int player_choice, computer_choice, player_score = 0, computer_score = 0;
srand(time(NULL));
@ -3382,7 +3426,7 @@ int main(int argc, char *argv[]) {
int jump_to_menu = 0;
while (choice != 23 || jump_to_menu) {
while (choice != 24 || jump_to_menu) {
printf("Welcome to the Game Menu!\n");
printf("1. QuizGame\n");
printf("2. Fact or Lie?\n");
@ -3406,7 +3450,8 @@ int main(int argc, char *argv[]) {
printf("20. All About Space and the Universe!\n");
printf("21. Brain whiz\n");
printf("22. Personality Quiz!\n");
printf("23. Exit\n");
printf("23. Guess the Celebrity!\n");
printf("24. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
v_progress_bar(argc,argv);
@ -3500,7 +3545,11 @@ int main(int argc, char *argv[]) {
b_personality();
jump_to_menu = 1;
break;
case 23:
case 23:
b_celebrity();
jump_to_menu = 1;
break;
case 24:
printf("\nThank you for trying our C code!\n");
break;
default:

5
src/main/quizproject.h

@ -145,6 +145,11 @@ int energetic;
int optimistic;
int empathetic;
//Guess the celebrity headers
void b_celebrity();
char celebrity[20];
char answer;
//-------brain_whiz_header_begin------------
void for_loop_print_question(char [][140], char [][140], char []);

Loading…
Cancel
Save