From 9b6699b5431a3c477da9d8ab39e12107e80828df Mon Sep 17 00:00:00 2001 From: Simon Wiesend Date: Fri, 7 Nov 2025 08:02:30 +0100 Subject: [PATCH] seed random number --- Start_Linux/game.c | 2 ++ Start_Windows/game.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Start_Linux/game.c b/Start_Linux/game.c index 11034ad..8bd3506 100644 --- a/Start_Linux/game.c +++ b/Start_Linux/game.c @@ -13,6 +13,8 @@ // 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, char words[][MAX_WORD_LEN], unsigned int wordCount) { + srand(time(NULL)); + int row, col, placedWords = 0; // Gesamtes Feld auf 0 setzen diff --git a/Start_Windows/game.c b/Start_Windows/game.c index 11034ad..8bd3506 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -13,6 +13,8 @@ // 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, char words[][MAX_WORD_LEN], unsigned int wordCount) { + srand(time(NULL)); + int row, col, placedWords = 0; // Gesamtes Feld auf 0 setzen