TODO in main.c implementiert
This commit is contained in:
1 parent
917f79708e
commit
783bb755e9
1 file changed
+13
-3
+13
-3
@@ -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
|
||||||
// Start the game if successful
|
if (placedWords == wordCount)
|
||||||
// error message if some words couldn't be placed
|
{
|
||||||
|
// Start the game if successful
|
||||||
|
startGame(wordSalad, SALAD_SIZE, words, wordCount, 800);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 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
|
||||||
|
|||||||
Reference in new issue
Block a user