diff --git a/Startcode/main.c b/Startcode/main.c index 03da755..3cfef84 100644 --- a/Startcode/main.c +++ b/Startcode/main.c @@ -35,11 +35,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 + + if (wordCount == placedWords) + { + startGame(wordSalad, SALAD_SIZE, words, wordCount, 1000); + } + else + { + fprintf(stderr, "Not all words could be placed in the grid.\nOnly %d of %d could be placed", placedWords, wordCount); + exitCode = EXIT_FAILURE; + } } else