From 208e35e934f2f9bde204454d5a6b6ed578afd8da Mon Sep 17 00:00:00 2001 From: Elena Riedmann Date: Tue, 31 Mar 2026 14:48:38 +0200 Subject: [PATCH] =?UTF-8?q?umge=C3=A4ndert=20in=20ourversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Start_Linux/input.c | 6 +++--- Start_Linux/input.h | 1 + Start_Linux/main.c | 4 +++- Start_Linux/makefile | 2 +- Start_Linux/words.txt | 6 +----- .../{wordsalad_initial => wordsalad_ourversion} | Bin 6 files changed, 9 insertions(+), 10 deletions(-) rename Start_Linux/{wordsalad_initial => wordsalad_ourversion} (100%) diff --git a/Start_Linux/input.c b/Start_Linux/input.c index 3b0d136..94e1170 100644 --- a/Start_Linux/input.c +++ b/Start_Linux/input.c @@ -4,11 +4,11 @@ // TODO: // eine Funktion implementieren, die ein einzelnes Wort aus einer Textdatei (words.txt) einliest und als C-String zurückgibt. -string readWord(FILE *file) +char* readWord(FILE *file) { char word[MAX_WORD_LEN]; // Puffer für Wort int index = 0; // Position im Puffer - int c; // Variablefür jedes gelesene Zeichen + int c; // Variable für jedes gelesene Zeichen // Whitespace überspringen while(isspace(c = fgetc(file))); //isspace checkt ob gelesenes Zeichen whitespace ist, wenn ja 1 wenn nein 0 @@ -41,5 +41,5 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) } } - return count; // Anzahl der gelesenen Wörter zurückgeben + return count; // Anzahl gelesene Wörter zurückgeben } \ No newline at end of file diff --git a/Start_Linux/input.h b/Start_Linux/input.h index 032ec28..d3a1345 100644 --- a/Start_Linux/input.h +++ b/Start_Linux/input.h @@ -6,6 +6,7 @@ #define MAX_WORD_LEN 100 #define MAX_LINE_LEN 1024 +char* readWord(FILE *file); int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount); #endif diff --git a/Start_Linux/main.c b/Start_Linux/main.c index 9e014b8..9375d98 100644 --- a/Start_Linux/main.c +++ b/Start_Linux/main.c @@ -39,13 +39,15 @@ int main(int argc, char *argv[]) // Start the game if successful // error message if some words couldn't be placed + // DONE + // Create the word salad by placing words into grid placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); if(placedWords==wordCount) { - // Spiel starten, mit dem erstellten wordSalad, der Anzahl der Wörter und der Liste der Wörter + // Spiel starten, mit dem erstellten wordSalad, der Anzahl der Wörter und der Liste der Wörter, 800 = Fensterbreite startGame(wordSalad, SALAD_SIZE, words, wordCount, 800); } else diff --git a/Start_Linux/makefile b/Start_Linux/makefile index a8d8f59..8108b58 100644 --- a/Start_Linux/makefile +++ b/Start_Linux/makefile @@ -10,7 +10,7 @@ unityfolder = ./unity # initiales Spiel bauen # -------------------------- wordsalad_initial: - $(CC) -o wordsalad_initial -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) + $(CC) -o wordsalad_ourversion -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) # -------------------------- # Normales Spiel bauen diff --git a/Start_Linux/words.txt b/Start_Linux/words.txt index 31ee099..9cd3823 100644 --- a/Start_Linux/words.txt +++ b/Start_Linux/words.txt @@ -1,5 +1 @@ -Yeti,Nessie Werwolf; Vampir -Monster -Hydra;Frankenstein -Dracula;KingKong;Gremlin;Kobold,Hexe;Poltergeist -Gespenst, Oger \ No newline at end of file +Yeti Nessie Werwolf Vampir Monster Hydra Frankenstein Dracula KingKong Gremlin Kobold Hexe Poltergeist Gespenst Oger \ No newline at end of file diff --git a/Start_Linux/wordsalad_initial b/Start_Linux/wordsalad_ourversion similarity index 100% rename from Start_Linux/wordsalad_initial rename to Start_Linux/wordsalad_ourversion