diff --git a/Start_Windows/game.c b/Start_Windows/game.c index 82dd644..8af924c 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -84,7 +84,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi } } printf("Words aborted: %d\n", wordsaborted); - return wordsplaced; + return wordsaborted;; } // Prints the word salad to console diff --git a/Start_Windows/main.c b/Start_Windows/main.c index f835a7a..5695ff1 100644 --- a/Start_Windows/main.c +++ b/Start_Windows/main.c @@ -10,6 +10,7 @@ int main(int argc, char *argv[]) { int exitCode = EXIT_SUCCESS; + int wordsaborted; // Check if the correct number of arguments is provided if(argc != 2) @@ -34,13 +35,13 @@ int main(int argc, char *argv[]) fclose(file); // Create the word salad by placing words into grid - placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); + wordsaborted = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); // Start game if all valid words were placed - if (placedWords == wordCount) { + if (wordsaborted == 0) { startGame(wordSalad, SALAD_SIZE, words, wordCount, 750); } else { - printf("Could not place all valid words. Placed %d out of %d words.\n", placedWords, wordCount); + printf("Could not place all valid words. Placed %d out of %d words.\n", wordCount - wordsaborted, wordCount); } } diff --git a/Start_Windows/unit_tests.c b/Start_Windows/unit_tests.c index 50a62cf..68f3efb 100644 --- a/Start_Windows/unit_tests.c +++ b/Start_Windows/unit_tests.c @@ -1,7 +1,7 @@ #include #include #include -#include "unity.h" +#include "unity/unity.h" #include "input.h" #include "game.h"