This commit is contained in:
Helena Köhler
2025-11-04 18:50:22 +01:00
3 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
} }
strncpy(words[word_count], token, MAX_WORD_LEN -1); strncpy(words[word_count], token, MAX_WORD_LEN -1);
words[word_count][MAX_WORD_LEN -1] = '\0'; words[word_count][MAX_WORD_LEN -1] = '\0';
word_count++ word_count++;
} }
//Nächstes Wort //Nächstes Wort
token = strtok(NULL, " ,;\n"); token = strtok(NULL, " ,;\n");
+3 -5
View File
@@ -42,18 +42,16 @@ int main(int argc, char *argv[])
// error message if some words couldn't be placed // error message if some words couldn't be placed
if (placedWords == wordCount) if (placedWords == wordCount)
{ {
printf("Alle %u Wörter wurden erfolgreich platziert!\n\n", wordCount); printf("Alle %u Wörter wurden erfolgreich plazieret!\n\n", wordCount);
// Spiel Start
//Spiel starten
startGame(wordSalad, SALAD_SIZE, words, wordCount, 800); startGame(wordSalad, SALAD_SIZE, words, wordCount, 800);
} }
else else
{ {
fprintf(stderr, "Fehler: Nur %u von %u Wörtern konnten platziert werden.\n", placedWords, wordCount); fprintf(stderr, "Fehler: Nur %u von %u Wörtern konnten plaziert werden.\n", placedWords, wordCount);
exitCode = EXIT_FAILURE; exitCode = EXIT_FAILURE;
} }
} }
else else
{ {
Binary file not shown.