From 6f9f3a55d27ae99b5e083bf24d006bd6f3b6eed2 Mon Sep 17 00:00:00 2001 From: Pascal Schneider Date: Mon, 5 Feb 2024 23:20:40 +0100 Subject: [PATCH] =?UTF-8?q?For-Schleife=20f=C3=BCr=20Fragen=20Shuffle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/timequiz.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/timequiz.c b/src/timequiz.c index 006ac45..9e53409 100644 --- a/src/timequiz.c +++ b/src/timequiz.c @@ -21,4 +21,10 @@ void timequiz() { int correctAnswers[] = { 1 }; + for (int i = 0; i < sizeof(questions) / sizeof(questions[0]); i++) { + int j = rand() % 4; + char* temp = answers[i][0]; + answers[i][0] = answers[i][j]; + answers[i][j] = temp; + } }