diff --git a/Start_Linux/main.c b/Start_Linux/main.c index cbfdaf5..c42c079 100644 --- a/Start_Linux/main.c +++ b/Start_Linux/main.c @@ -37,17 +37,21 @@ int main(int argc, char *argv[]) placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); // Check if all words were successfully placed - // Start the game if successful // error message if some words couldn't be placed - if (placedWords < wordCount) { - fprintf(stderr, "some words couldn't be placed\n"); - exitCode = EXIT_FAILURE; + int notPlacedNum = wordCount - placedWords; + fprintf(stderr, "%d word(s) couldn't be placed\n", notPlacedNum); } // TODO: - // Start the game if successful + // correct parameters for startGame + + // Start the game if at least 1 word has been successfully placed + else if (placedWords >= 1) + { + startGame(wordSalad, 80, words, placedWords, 800); + } } else { diff --git a/Start_Windows/main.c b/Start_Windows/main.c index cbfdaf5..c42c079 100644 --- a/Start_Windows/main.c +++ b/Start_Windows/main.c @@ -37,17 +37,21 @@ int main(int argc, char *argv[]) placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); // Check if all words were successfully placed - // Start the game if successful // error message if some words couldn't be placed - if (placedWords < wordCount) { - fprintf(stderr, "some words couldn't be placed\n"); - exitCode = EXIT_FAILURE; + int notPlacedNum = wordCount - placedWords; + fprintf(stderr, "%d word(s) couldn't be placed\n", notPlacedNum); } // TODO: - // Start the game if successful + // correct parameters for startGame + + // Start the game if at least 1 word has been successfully placed + else if (placedWords >= 1) + { + startGame(wordSalad, 80, words, placedWords, 800); + } } else {