diff --git a/Start_Windows/game.c b/Start_Windows/game.c index 2ba49c0..0bb846b 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -59,38 +59,40 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi unsigned int erfolgreichGesetzt = 0; //Wörter zufällig platzieren - //for(unsigned int w = 0, w < wordCount, w++) { + //for(unsigned int w = 0; w < wordCount; w++) { - for (unsigned int w = 0, w < wordCount, w++) - { + for (unsigned int w = 0; w < wordCount; w++) + { int platziert = 0; - for (int versuch = 0; versuch < MAX_RAND_TRIES_PER_WORD && !platziert; versuch++) { + for (int versuch = 0; versuch < MAX_RAND_TRIES_PER_WORD && !platziert; versuch++) + { int richtung = rand() % 2; // 0 = horizontal, 1 = vertikal int zeile = rand() % searchFieldLen; int spalte = rand() % searchFieldLen; platziert = platziereWort(salad, searchFieldLen, words[w], zeile, spalte, richtung); - } + } if (platziert) erfolgreichGesetzt++; else 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++) { + for (unsigned int i = 0; i < searchFieldLen; i++) + { + for (unsigned int j = 0; j < searchFieldLen; j++) + { if (salad[i][j] == EMPTY_CHAR) salad[i][j] = 'A' + rand() % 26; } - // } + } - return erfolgreichGesetzt; - - } + return erfolgreichGesetzt; } + @@ -103,9 +105,11 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi 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++) { + for (unsigned int j = 0; j < searchFieldLen; j++) + { printf("%c ", salad[i][j]); } + printf("\n"); } diff --git a/Start_Windows/input.o b/Start_Windows/input.o deleted file mode 100644 index fa4588c..0000000 Binary files a/Start_Windows/input.o and /dev/null differ diff --git a/Start_Windows/main.c b/Start_Windows/main.c index 15f2789..cab466b 100644 --- a/Start_Windows/main.c +++ b/Start_Windows/main.c @@ -46,8 +46,8 @@ int main(int argc, char *argv[]) printf("Alle %u Wörter wurden erfolgreich platziert!\n\n", wordCount); // Spiel starten - showWordSalad(wordSalad, SALAD_SIZE); - // oder: startGraphicalGame(wordSalad, SALAD_SIZE, words, wordCount); + //showWordSalad(wordSalad, SALAD_SIZE); + startGame(wordSalad, SALAD_SIZE, words, wordCount, ); } else diff --git a/Start_Windows/wordsalad_initial.exe b/Start_Windows/wordsalad_initial.exe deleted file mode 100644 index dccfcaa..0000000 Binary files a/Start_Windows/wordsalad_initial.exe and /dev/null differ