TODO in main.c implementiert

This commit is contained in:
Baeuml committed 2026-10-28 00:02:26 +01:00
1 parent 917f79708e
commit 783bb755e9
1 file changed
+11 -1
+11 -1
View File
@@ -10,7 +10,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int exitCode = EXIT_SUCCESS; int exitCode = EXIT_SUCCESS;
//a
// Check if the correct number of arguments is provided // Check if the correct number of arguments is provided
if(argc != 2) if(argc != 2)
{ {
@@ -37,9 +37,19 @@ int main(int argc, char *argv[])
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
// TODO: // TODO:
// Check if all words were successfully placed // Check if all words were successfully placed
if (placedWords == wordCount)
{
// Start the game if successful // Start the game if successful
startGame(wordSalad, SALAD_SIZE, words, wordCount, 800);
}
else
{
// error message if some words couldn't be placed // error message if some words couldn't be placed
fprintf(stderr, "Error: Only %u of %u words could be placed.\n", placedWords, wordCount);
exitCode = EXIT_FAILURE;
}
} }
else else