Browse Source

refactoring: 14 Kommentar zu Ablauf innerhalb if-Funktion am Beispiel Runde 1-5

remotes/origin/Christian
Christian Reum 11 months ago
parent
commit
480637e18c
  1. 14
      src/wwm.c

14
src/wwm.c

@ -161,25 +161,27 @@ void wwm(){
printf("Congratulations ! You have won 1.000.000 $"); printf("Congratulations ! You have won 1.000.000 $");
return; return;
} }
// If für Runde 1-5
if (r <= 5) { if (r <= 5) {
printf("__________________________________________________ \n\n"); printf("__________________________________________________ \n\n");
printf("You are at stage %d and have %d $\n", runde, geld); printf("You are at stage %d and have %d $\n", runde, geld);
crandomNumber();
printf("Question %d: %s\n", runde + 1, question_easy[frage]);
crandomNumber(); //Berechnung welcher Frage
printf("Question %d: %s\n", runde + 1, question_easy[frage]); //Frage Ausgabe
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
printf("%d. %s \n", i + 1, answers_easy[frage][i]); printf("%d. %s \n", i + 1, answers_easy[frage][i]);
}
} // Antwortenb Ausgabe
ceingabe();
ceingabe(); // Eingabe Antwort, automatische Eingabeprüfung auf Zahlen 1-4
// Prüfung auf korrekte Antwort
// korrekte Antwort
if (useranswer == correctAnswer_easy[frage]) { if (useranswer == correctAnswer_easy[frage]) {
printf("That is correct!\n"); printf("That is correct!\n");
runde++; runde++;
setGeld(runde); setGeld(runde);
} }
// falsche Antwort
else { else {
printf("That is a shame! That is wrong!\n You lost %d $", geld); printf("That is a shame! That is wrong!\n You lost %d $", geld);
return; return;

Loading…
Cancel
Save