From c3e875f493f8322e8517b57fac51ea40731f87fb Mon Sep 17 00:00:00 2001 From: Tabea Kleinlein Date: Mon, 26 Oct 2026 00:49:47 +0100 Subject: [PATCH] =?UTF-8?q?Spielinitialisierung=20in=20main.c=20und=20Make?= =?UTF-8?q?file=20Target=20wordsalad=5Fmyversion=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Startcode/main.c | 11 ++++++++++- Startcode/makefile | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Startcode/main.c b/Startcode/main.c index 03da755..a40274d 100644 --- a/Startcode/main.c +++ b/Startcode/main.c @@ -6,6 +6,7 @@ #define MAX_NUMBER_OF_WORDS 100 #define SALAD_SIZE 20 +#define WINDOW_WIDTH 800 //Breite Spielfenster 800 Pixel int main(int argc, char *argv[]) { @@ -36,10 +37,18 @@ int main(int argc, char *argv[]) // Create the word salad by placing words into grid placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); - // TODO: + // TODO: erledigt // Check if all words were successfully placed // Start the game if successful // error message if some words couldn't be placed + if (placedWords == wordCount) //wenn alle Wörter erfolgreicht plaziert sind + { + startGame(wordSalad, SALAD_SIZE, words, wordCount, WINDOW_WIDTH); //Startet das Spiel + } + else + { + printf("Fehler: Es konnten nicht alle Wörter plaziert werden\n"); //Gibt Fehlermeldung aus + } } else diff --git a/Startcode/makefile b/Startcode/makefile index 7cf1d4c..754aad9 100644 --- a/Startcode/makefile +++ b/Startcode/makefile @@ -22,6 +22,13 @@ codefolder = . wordsalad_initial: $(CC) -o wordsalad_initial -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) +# -------------------------- +# meine Version +# -------------------------- +wordsalad_myversion: main.o graphicalGame.o $(BINARIES)/libraylib.a + $(CC) $(CFLAGS) -o wordsalad_myversion main.o graphicalGame.o $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS) + + # -------------------------- # Normales Spiel bauen # --------------------------