diff --git a/game.c b/game.c index 803301f..7529d6f 100644 --- a/game.c +++ b/game.c @@ -3,7 +3,7 @@ #include #include -#define MAX_RAND_TRIES_PER_WORD 10 +#define MAX_RAND_TRIES_PER_WORD 1000 #define EMPTY_CHAR 0 //TODO: Spiellogik implementieren: @@ -13,5 +13,77 @@ // 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, const char words[][MAX_WORD_LEN], unsigned int wordCount) { + srand(time(NULL)); + int i,j; + int Woertergesetzt = 0; + for (i=0 ; i