Browse Source

Added Personality Quiz and headers

main
fdlt3885 2 years ago
parent
commit
183ef21a38
  1. 55
      src/main/quizproject.c
  2. 7
      src/main/quizproject.h

55
src/main/quizproject.c

@ -2739,7 +2739,53 @@ void b_historyevents() {
printf("Thanks for playing!\n");
}
void b_personality() {
char name[100];
printf("What's your name? ");
scanf("%s", name);
printf("On a scale of 1 to 10, how introverted are you? ");
scanf("%d", &introverted);
printf("On a scale of 1 to 10, how energetic are you? ");
scanf("%d", &energetic);
printf("On a scale of 1 to 10, how optimistic are you? ");
scanf("%d", &optimistic);
printf("On a scale of 1 to 10, how empathetic are you? ");
scanf("%d", &empathetic);
printf("\nSummary for %s:\n\n", name);
printf("Based on your answers, %s is a person who is\n ", name);
if (introverted >= 7) {
printf("introverted and tends to prefer more solitary activities.\n ");
} else {
printf("extroverted and tends to enjoy being in social situations.\n ");
}
if (energetic >= 7) {
printf("They are full of energy and always on the go.\n ");
} else {
printf("They are relaxed and tend to take a more laid-back approach to life.\n ");
}
if (optimistic >= 7) {
printf("They have an optimistic outlook on life and are generally hopeful and positive.\n ");
} else {
printf("They have a pessimistic outlook on life and tend to focus on the negative.\n ");
}
if (empathetic >= 7) {
printf("%s is a very empathetic person who is able to understand and connect with others.\n ", name);
} else {
printf("%s is not as empathetic and may have trouble connecting with others emotionally.\n ", name);
}
printf("\n\nThis is just a general summary based on the answers provided.\nEveryone is unique and complex, and these answers only provide a limited \nview into %s's personality.", name);
}
void v_play_rockpapersciss(){
int player_choice, computer_choice, player_score = 0, computer_score = 0;
@ -3336,7 +3382,7 @@ int main(int argc, char *argv[]) {
int jump_to_menu = 0;
while (choice != 22 || jump_to_menu) {
while (choice != 23 || jump_to_menu) {
printf("Welcome to the Game Menu!\n");
printf("1. QuizGame\n");
printf("2. Fact or Lie?\n");
@ -3359,7 +3405,8 @@ int main(int argc, char *argv[]) {
printf("19. Mini-Game: History Quiz!\n");
printf("20. All About Space and the Universe!\n");
printf("21. Brain whiz\n");
printf("22. Exit\n");
printf("22. Personality Quiz!\n");
printf("23. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
v_progress_bar(argc,argv);
@ -3450,6 +3497,10 @@ int main(int argc, char *argv[]) {
jump_to_menu = 1;
break;
case 22:
b_personality();
jump_to_menu = 1;
break;
case 23:
printf("\nThank you for trying our C code!\n");
break;
default:

7
src/main/quizproject.h

@ -138,6 +138,13 @@ void b_gamble();
//History Game Headers
void b_historyevents();
//Personality Quiz Headers
void b_personality();
int introverted;
int energetic;
int optimistic;
int empathetic;
//-------brain_whiz_header_begin------------
void for_loop_print_question(char [][140], char [][140], char []);

Loading…
Cancel
Save