diff --git a/Start_Windows/game.c b/Start_Windows/game.c index 4241e4c..4661b13 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -1,7 +1,9 @@ +/**/ #include "game.h" #include #include #include +#include #define MAX_RAND_TRIES_PER_WORD 10 @@ -12,6 +14,7 @@ * restliche Felder mit zufälligen Buchstaben füllen */ // Creates the word salad by placing words randomly and filling empty spaces +/* int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount) { srand(time(NULL)); @@ -128,4 +131,4 @@ void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], } printf("\n"); } -} \ No newline at end of file +} *\ \ No newline at end of file diff --git a/Start_Windows/game.o b/Start_Windows/game.o index e9e1831..5c94716 100644 Binary files a/Start_Windows/game.o and b/Start_Windows/game.o differ diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 4cd0faf..cbb60ab 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -1,3 +1,4 @@ +/* #include "input.h" #include #include @@ -16,17 +17,22 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) while(fgets(puffer, MAX_LINE_LEN-1, file) != NULL && counter < maxWordCount) { char *word_parts = strtok(puffer, ",;\n\t/. "); //Wörter aufteilen - + printf("..."); while(word_parts != NULL && counter < maxWordCount) { + printf("!!!!"); for(i = 0; i < MAX_WORD_LEN -1 && word_parts[i] != '\0'; i++) { - words[counter][i] = toupper(word_parts[i]); //Großbuchstaben erzeugen + printf("????"); + words[counter][i] = toupper(word_parts[i]); //Großbuchstaben erzeugen } words[counter][i] = '\0'; //Stringdefinition vervollständigen + + counter++; // Wort eingelesen, Wortzähler erhöhen + word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben + } - counter++; // Wort eingelesen, Wortzähler erhöhen - word_parts = strtok(NULL, ",;\n\t/. "); //NULL für Zeiger angeben + } return counter; } \ No newline at end of file diff --git a/Start_Windows/makefile b/Start_Windows/makefile index b0ff65b..b25496c 100644 --- a/Start_Windows/makefile +++ b/Start_Windows/makefile @@ -33,7 +33,7 @@ graphicalGame.o: graphicalGame.c # -------------------------- # Unit Tests # -------------------------- -TEST_BIN = runTests +TEST_BIN = runTests2 test: input.o game.o unit_tests.c $(CC) $(CFLAGS) -I$(unityfolder) -o $(TEST_BIN) input.o game.o unit_tests.c $(BINARIES)/libunity.a diff --git a/Start_Windows/runTests2.exe b/Start_Windows/runTests2.exe new file mode 100644 index 0000000..7d06fb1 Binary files /dev/null and b/Start_Windows/runTests2.exe differ