From 4c95dda0807b83d0ab234964659ae2c91844da5a Mon Sep 17 00:00:00 2001 From: fdlt3917 Date: Thu, 26 Jan 2023 10:42:04 +0000 Subject: [PATCH] randomized round 5 --- src/main/quizproject.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index da442af..cea2c30 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -285,17 +285,18 @@ void ask_hard_questions(void) { printf(">>This is the final round. Good Luck!<<\n\n"); for (int i = 0; i < 2; i++) { - printf("[%d] %s\n", i + 1, questions[i]); + randNum = arr[i]; + printf("[%d] %s\n", i + 1, questions[randNum]); for (int j = 0; j < 4; j++) { - printf("%s\n", options[i][j]); + printf("%s\n", options[randNum][j]); } printf("Enter your answer (A, B, C, or D): "); char response; scanf(" %c", &response); response = toupper(response); - user_answers[i] = response; + user_answers[randNum] = response; // check each answer - if (user_answers[i] == answers[i]) { + if (user_answers[randNum] == answers[randNum]) { score++; correct(score); } else {