diff --git a/Start_Windows/input.c b/Start_Windows/input.c index db5cdbf..9466ce0 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -33,7 +33,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) //Speichere das Wort im Array, falls es nicht leer ist if (len > 0){ //Wandel das Wort in Großbuchstaben um - for (size_t = 0; i < len; i++ ){ + for (size_t i = 0; i < len; i++ ){ token[i] = toupper ((unsigned char)token[i]); } strncpy(words[word_count], token, MAX_WORD_LEN -1); diff --git a/Start_Windows/input.o b/Start_Windows/input.o new file mode 100644 index 0000000..6a1c400 Binary files /dev/null and b/Start_Windows/input.o differ diff --git a/game.c b/game.c index 8ed53df..8181c10 100644 --- a/game.c +++ b/game.c @@ -70,21 +70,22 @@ unsigned int erfolgreichGesetzt = 0; fprintf(stderr, "Warnung: Konnte Wort nicht platzieren: %s\n", words[w]); } -} -//Leere Felder mit Zufallsbuchstaben füllen -for (unsigned int i = 0; i < searchFieldLen; i++) -{ - for (unsigned int j = 0; j < searchFieldLen; j++) + + //Leere Felder mit Zufallsbuchstaben füllen + for (unsigned int i = 0; i < searchFieldLen; i++) { - if (salad[i][j] == EMPTY_CHAR) - salad[i][j] = 'A' + rand() % 26; - } + for (unsigned int j = 0; j < searchFieldLen; j++) + { + if (salad[i][j] == EMPTY_CHAR) + salad[i][j] = 'A' + rand() % 26; + } + return erfolgreichGesetzt; } // Prints the word salad to console -void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen) +void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen); { for (unsigned int i = 0; i < searchFieldLen; i++){ for (unsigned int j = 0; j < searchFieldLen; j++)