This commit is contained in:
Helena Köhler 2025-11-04 18:50:22 +01:00
commit 0d192b71fd
3 changed files with 9 additions and 11 deletions

View File

@ -36,9 +36,9 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
for (size_t = 0; i < len; i++ ){
token[i] = toupper ((unsigned char)token[i]);
}
strncpy(words[word_count], token, MAX_WORD_LEN -1);
words[word_count][MAX_WORD_LEN -1] = '\0';
word_count++
strncpy(words[word_count], token, MAX_WORD_LEN -1);
words[word_count][MAX_WORD_LEN -1] = '\0';
word_count++;
}
//Nächstes Wort
token = strtok(NULL, " ,;\n");

View File

@ -42,18 +42,16 @@ int main(int argc, char *argv[])
// error message if some words couldn't be placed
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
{
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;
}
}
else
{

Binary file not shown.