|
@ -8,12 +8,19 @@ int generateRandomNumber(int min, int max) { |
|
|
return rand() % (max - min + 1) + min; |
|
|
return rand() % (max - min + 1) + min; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int getUserAnswer() { |
|
|
int getUserAnswer() { |
|
|
int userAnswer; |
|
|
int userAnswer; |
|
|
scanf("%d", &userAnswer); |
|
|
scanf("%d", &userAnswer); |
|
|
return userAnswer; |
|
|
return userAnswer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void printQuestion(int num1, int num2, int round) { |
|
|
|
|
|
printf("\n--- Frage %d ---\n", round); |
|
|
|
|
|
printf("%d + %d = ?", num1, num2); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Funktion zum Durchführen des Mathematikspiels |
|
|
// Funktion zum Durchführen des Mathematikspiels |
|
|
void runMathGame(int rounds) { |
|
|
void runMathGame(int rounds) { |
|
|