diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 1c256b0..648358d 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -214,7 +214,8 @@ void guess_word_questions() { "se_t_em__t", "___lia___ta_y", "m_n_s__r__s", - "si__if_ca__e" + "si__if_ca__e", + "ch__le_g_" }; char guess_solution [][100] = { @@ -229,7 +230,8 @@ void guess_word_questions() { "tlen", "parmenr", "oateie", - "gninc" + "gninc", + "alne" }; char word_guessed[][100] = { @@ -244,14 +246,15 @@ void guess_word_questions() { "settlement", "Parliamentary", "monasteries", - "significance" + "significance", + "challenge" }; - - print_guess_word_question (guess_words, guess_solution,word_guessed); + int* randArr0 = randomNumber(); + print_guess_word_question (guess_words, guess_solution,word_guessed, randArr0); } -void print_guess_word_question (char guessWord[][100], char guessSolution[][100],char guessedWord[][100]){ +void print_guess_word_question (char guessWord[][100], char guessSolution[][100],char guessedWord[][100], int randArr[]){ printf("\t\t---------------------------Round4-----------------------------\n\n"); printf("\t\t >>You have to guess what word it is by filling\n"); @@ -260,17 +263,18 @@ void print_guess_word_question (char guessWord[][100], char guessSolution[][100] for (int j = 0; j < 4; j ++) { + int runNum = randArr[j]; char usr_ans[100]; int k = 0; - printf("[%d]. Guess the word by finding the missing Letters:\n %s: \n",j+1, guessWord[j]); + printf("[%d]. Guess the word by finding the missing Letters:\n %s: \n",j+1, guessWord[runNum]); printf(" Your answer: "); scanf("%s",usr_ans); char arr[30]; for(int p = 0; p < 30; p++) { - arr[p] = guessSolution[j][p]; + arr[p] = guessSolution[runNum][p]; - if (guessSolution[j][p] == '\0') { + if (guessSolution[runNum][p] == '\0') { break; } @@ -287,7 +291,7 @@ void print_guess_word_question (char guessWord[][100], char guessSolution[][100] if (k == strlen(arr) && strlen(usr_ans) == strlen(arr)) { score++; printf("Correct!\nYou have %d points\n",score); - printf("You guessed right! The word is rightfully, %s!\n\n", guessedWord[j]); + printf("You guessed right! The word is rightfully, %s!\n\n", guessedWord[runNum]); } else { printf("Wrong!\nYou have %d points\n", score); } diff --git a/src/main/quizproject.h b/src/main/quizproject.h index 4570183..ecde000 100644 --- a/src/main/quizproject.h +++ b/src/main/quizproject.h @@ -46,7 +46,7 @@ void e_questions_r3(void); void e_printout_r3 (char [][100], char [][100]); int track_r2_score = 0; void guess_word_questions(void); -void print_guess_word_question (char [][100], char [][100],char [][100]); +void print_guess_word_question (char [][100], char [][100],char [][100], int []); //----smart_brain_header_end------- //Epic Game Headers