diff --git a/Start_Windows/main.c b/Start_Windows/main.c index e0791a0..09dc742 100644 --- a/Start_Windows/main.c +++ b/Start_Windows/main.c @@ -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); + } } }