Compare commits

...

2 Commits

2 changed files with 7 additions and 5 deletions

View File

@ -59,12 +59,13 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
unsigned int erfolgreichGesetzt = 0; unsigned int erfolgreichGesetzt = 0;
//Wörter zufällig platzieren //Wörter zufällig platzieren
for(unisgned int w = 0; w < wordCount; w++) { //for(unsigned int w = 0, w < wordCount, w++) {
int platziert = 0;
for (unsigned int w = 0; w < wordCount; w++) for (unsigned int w = 0, w < wordCount, w++)
{ {
for (int versuch = 0; versuch < MAX_RAND_TRIES_PER_WORD && !platziert; versuch++) { int platziert = 0;
for (int versuch = 0; versuch < MAX_RAND_TRIES_PER_WORD && !platziert; versuch++) {
int richtung = rand() % 2; // 0 = horizontal, 1 = vertikal int richtung = rand() % 2; // 0 = horizontal, 1 = vertikal
int zeile = rand() % searchFieldLen; int zeile = rand() % searchFieldLen;
int spalte = rand() % searchFieldLen; int spalte = rand() % searchFieldLen;
@ -83,10 +84,11 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
if (salad[i][j] == EMPTY_CHAR) if (salad[i][j] == EMPTY_CHAR)
salad[i][j] = 'A' + rand() % 26; salad[i][j] = 'A' + rand() % 26;
} }
} // }
return erfolgreichGesetzt; return erfolgreichGesetzt;
} }
} }

BIN
Start_Windows/input.o Normal file

Binary file not shown.