diff --git a/I2_Wortsalat/Start_Linux/game.c b/I2_Wortsalat/Start_Linux/game.c index 1c8027c..a8905e1 100644 --- a/I2_Wortsalat/Start_Linux/game.c +++ b/I2_Wortsalat/Start_Linux/game.c @@ -30,6 +30,7 @@ void fillRestWithRandom(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], // - wordCount -> anzahl an Wörtern 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)); int placedWords = 0; //Feld komplettmit EMPTY_CHAR füllen @@ -85,7 +86,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi if (y + wordLength > searchFieldLen) continue; //Prüfen ob kein anderes Wort im Weg - int fits = 1; + int fits = 1; for (int i = 0; i < wordLength; i++) { if (salad[y + i][x] != EMPTY_CHAR) diff --git a/I2_Wortsalat/Start_Mac/game.c b/I2_Wortsalat/Start_Mac/game.c index 1c8027c..a8905e1 100644 --- a/I2_Wortsalat/Start_Mac/game.c +++ b/I2_Wortsalat/Start_Mac/game.c @@ -30,6 +30,7 @@ void fillRestWithRandom(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], // - wordCount -> anzahl an Wörtern 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)); int placedWords = 0; //Feld komplettmit EMPTY_CHAR füllen @@ -85,7 +86,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi if (y + wordLength > searchFieldLen) continue; //Prüfen ob kein anderes Wort im Weg - int fits = 1; + int fits = 1; for (int i = 0; i < wordLength; i++) { if (salad[y + i][x] != EMPTY_CHAR) diff --git a/I2_Wortsalat/Start_Windows/game.c b/I2_Wortsalat/Start_Windows/game.c index 1c8027c..a8905e1 100644 --- a/I2_Wortsalat/Start_Windows/game.c +++ b/I2_Wortsalat/Start_Windows/game.c @@ -30,6 +30,7 @@ void fillRestWithRandom(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], // - wordCount -> anzahl an Wörtern 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)); int placedWords = 0; //Feld komplettmit EMPTY_CHAR füllen @@ -85,7 +86,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi if (y + wordLength > searchFieldLen) continue; //Prüfen ob kein anderes Wort im Weg - int fits = 1; + int fits = 1; for (int i = 0; i < wordLength; i++) { if (salad[y + i][x] != EMPTY_CHAR)