From 88444954110e25d2c8f60c834a873eeaf83d652c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sun, 26 Oct 2025 16:17:28 +0100 Subject: [PATCH] =?UTF-8?q?placedWordCounter=20eingef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Start_Windows/game.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Start_Windows/game.c b/Start_Windows/game.c index 55bb062..f1ae028 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -29,6 +29,8 @@ int checkforOverlap(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], shor // 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) { + int placedCount = 0; + for(short i = 0; i < searchFieldLen; i++) { for(short j = 0; j < searchFieldLen; j++) @@ -71,10 +73,13 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi short yoffset = (waagrecht) ? 0 : k; salad[x+xoffset][y+yoffset]=words[i-1][k]; } + + placedCount++; } + return placedCount; }