From 3def251d1461c1529fe9d62434cc5575f9b86f5c Mon Sep 17 00:00:00 2001 From: fdlt3914 Date: Fri, 10 Feb 2023 03:22:45 +0000 Subject: [PATCH] refactoring: hint in anagram option appear --- src/main/quizproject.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 176b2de..295196c 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -348,13 +348,7 @@ void math_enter_game() { //-------smart_brain_quiz_begin---------- -/* -void e_press_key_start() { - char e_start_game; - scanf(" %c", &e_start_game); - e_start_game = toupper(e_start_game); -} -*/ + void hint_anagram(int hint_num) { char hint_questions[][100] = { "d_v_l_p_e_t", @@ -372,12 +366,12 @@ void hint_anagram(int hint_num) { void e_display_instruction() { printf("\t\t-------------------------------------------------------\n"); - printf("\t\t To start this Quiz, here are the instructions\n"); - printf("\t\t------------------------------------------------------\n\n"); + printf("\t\t >>To start this Quiz, here are the instructions<<\n"); + printf("\t\t------------------------------------------------------\n"); printf("\t\t>>In the first, second Round, you answer True or false questions.<<\n"); printf("\t\t>>In the third Round, you answer questions which test your General knowledge.<< \n"); printf("\t\t-------------------------------------------------------\n\n"); - printf( "\n\nDo you still wish to continue playing ? If yes, then press 1. Else, press 0 : " ); + printf( "\tDo you still wish to continue playing ? If yes, then press 1. Else, press 0 : " ); } @@ -418,7 +412,7 @@ void e_usr_answr(char question[][100], char ans[], int initial, int end, int ran void e_t_f_printQuestions(char askquestion[][100],char answers[], int charArr[]) { int track_rounds = 0; while(track_rounds < 1){ - printf("\t\t---------------------------Round1-----------------------------\n"); + printf("\n\t\t---------------------------Round1-----------------------------\n"); printf("\t\t >>In this round you will be presented with 3 questions.<<\n"); printf("\t\t>>You need to answer 2 questions correctly to move to Round 2<<\n"); printf("\t\t--------------------------------------------------------------\n\n"); @@ -478,8 +472,6 @@ bool e_true_false(char choice) { return true; } else if(choice == 'F') { return false; - } else { - return -1; } } @@ -654,7 +646,7 @@ void e_printout(char print_out_questn[][100], char questions[][100],int randArr[ for(int i = 0; i < 4; i++) { int rNum = randArr[i]; printf("[%d] Guess the correct word for this anagram: %s\n", i+1, print_out_questn[rNum]); - printf("Answer: "); + printf("Answer(type 'H' to get a hint): "); scanf("%s", usr_ans); for(int j = 0; j < strlen(usr_ans); j++) { if (toupper(usr_ans[j]) == 'H' && strlen(usr_ans) == 1) {