From 01b16608581f7cc55768211faad4173be0137a1c Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 26 Oct 2026 16:26:02 +0100 Subject: [PATCH] =?UTF-8?q?game.c=20vervollst=C3=A4ndigt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Startcode/game.c | 62 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/Startcode/game.c b/Startcode/game.c index 803301f..50411e2 100644 --- a/Startcode/game.c +++ b/Startcode/game.c @@ -6,12 +6,64 @@ #define MAX_RAND_TRIES_PER_WORD 10 #define EMPTY_CHAR 0 -//TODO: Spiellogik implementieren: -/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren - * restliche Felder mit zufälligen Buchstaben füllen */ - -// 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 row, col, word, startcol=0, startrow=0; + srand(time(NULL)); + for(row=0; row