From da201c79f094320a2f383e0224db7b523fcb9c95 Mon Sep 17 00:00:00 2001
From: fdlt3885 <berke.sevenler@lt.hs-fulda.de>
Date: Tue, 31 Jan 2023 21:52:00 +0000
Subject: [PATCH] added time function (epic game)

---
 src/main/quizproject.c | 15 +++++++++++++++
 src/main/quizproject.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/src/main/quizproject.c b/src/main/quizproject.c
index ef606e0..63fe338 100644
--- a/src/main/quizproject.c
+++ b/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) {
     printf("\t\t------------------------------------------\n\n");
     printf("\t\t------------------------------------------\n\n");
@@ -864,6 +878,7 @@ void b_epic_game() {
     B_username();
     B_userinfo();
     B_displayGameInstructions();
+    B_show_time();
 }
 
 
diff --git a/src/main/quizproject.h b/src/main/quizproject.h
index 8bcd341..5725d3f 100644
--- a/src/main/quizproject.h
+++ b/src/main/quizproject.h
@@ -52,6 +52,7 @@ int toupper(int _c);
 void B_sayhello(char name[]);
 void B_userinfo(void);
 void B_displayGameInstructions(void);
+void B_show_time(void);
 
 #define NUM_QUESTIONS 5
 #define round 3