Browse Source

added time function (epic game)

main
fdlt3885 2 years ago
parent
commit
da201c79f0
  1. 15
      src/main/quizproject.c
  2. 1
      src/main/quizproject.h

15
src/main/quizproject.c

@ -821,6 +821,20 @@ void play_guessTheWord() {
} }
void B_show_time(void) {
time_t current_time;
struct tm *time_info;
char time_string[9];
time(&current_time);
time_info = localtime(&current_time);
strftime(time_string, sizeof(time_string), "%H:%M", time_info);
printf("The current time is: %s\n", time_string);
}
void B_displayWelcomeMessage(void) { void B_displayWelcomeMessage(void) {
printf("\t\t------------------------------------------\n\n"); printf("\t\t------------------------------------------\n\n");
printf("\t\t------------------------------------------\n\n"); printf("\t\t------------------------------------------\n\n");
@ -864,6 +878,7 @@ void b_epic_game() {
B_username(); B_username();
B_userinfo(); B_userinfo();
B_displayGameInstructions(); B_displayGameInstructions();
B_show_time();
} }

1
src/main/quizproject.h

@ -52,6 +52,7 @@ int toupper(int _c);
void B_sayhello(char name[]); void B_sayhello(char name[]);
void B_userinfo(void); void B_userinfo(void);
void B_displayGameInstructions(void); void B_displayGameInstructions(void);
void B_show_time(void);
#define NUM_QUESTIONS 5 #define NUM_QUESTIONS 5
#define round 3 #define round 3

Loading…
Cancel
Save