Main.c um die fehldene Funktion erweitert

This commit is contained in:
silvana884 2025-11-06 12:25:29 +01:00
parent 27dc4dd02b
commit e2de303489

View File

@ -36,17 +36,16 @@ int main(int argc, char *argv[])
// Create the word salad by placing words into grid
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
// TODO:
// Check if all words were successfully placed
// Start the game if successful
// error message if some words couldn't be placed
}
else
{
// Print error message if file couldn't be opened
fprintf(stderr, "Could not open file %s for reading ...\n", argv[1]);
exitCode = EXIT_FAILURE;
if (placedWords != 0)
{
// Start the game if successful
startGame(wordSalad, SALAD_SIZE, words, wordCount,800);
}
else
{
fprintf(stderr, "Warning: Only %u out of %u words could be placed.\n", placedWords, wordCount);
}
}
}