Merge branch 'main' of https://git.efi.th-nuernberg.de/gitea/moehrleinai99137/info2_aufgabe1
This commit is contained in:
commit
0d192b71fd
@ -36,9 +36,9 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
for (size_t = 0; i < len; i++ ){
|
for (size_t = 0; i < len; i++ ){
|
||||||
token[i] = toupper ((unsigned char)token[i]);
|
token[i] = toupper ((unsigned char)token[i]);
|
||||||
}
|
}
|
||||||
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");
|
||||||
|
|||||||
@ -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.
Loading…
x
Reference in New Issue
Block a user