From 0bd55e367a98e7ea455c0639fbe919becbae1f79 Mon Sep 17 00:00:00 2001 From: Benedikt Hilpoltsteiner Date: Mon, 19 Oct 2026 08:49:38 +0200 Subject: [PATCH] Start des Spiels mit eigener main.c --- Startcode/main.c | 9 +++++++++ Startcode/makefile | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Startcode/main.c b/Startcode/main.c index 03da755..d099b15 100644 --- a/Startcode/main.c +++ b/Startcode/main.c @@ -41,6 +41,15 @@ int main(int argc, char *argv[]) // Start the game if successful // error message if some words couldn't be placed + if (placedWords == wordCount) { + startGame(wordSalad, SALAD_SIZE, words, wordCount, 800); + } + else { + //Fehlermeldung + fprintf(stderr, "Error: Could not place all words (%u of %u placed).\n", placedWords, wordCount); + exitCode = EXIT_FAILURE; + } + } else { diff --git a/Startcode/makefile b/Startcode/makefile index 7cf1d4c..3ce2974 100644 --- a/Startcode/makefile +++ b/Startcode/makefile @@ -22,6 +22,14 @@ codefolder = . wordsalad_initial: $(CC) -o wordsalad_initial -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) + +# -------------------------- +# eigenes Spiel bauen +# -------------------------- +wordsalad_myversion: main.o + $(CC) -o wordsalad_myversion main.o -L. $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS) + + # -------------------------- # Normales Spiel bauen # -------------------------- @@ -56,4 +64,4 @@ ifeq ($(OS),Windows_NT) del /f *.o *.exe else rm -f *.o wordsalad $(TEST_BIN) -endif \ No newline at end of file +endif