diff --git a/Start_Linux/game.o b/Start_Linux/game.o new file mode 100644 index 0000000..cc99743 Binary files /dev/null and b/Start_Linux/game.o differ diff --git a/Start_Linux/input.c b/Start_Linux/input.c index 94e1170..1f64a2d 100644 --- a/Start_Linux/input.c +++ b/Start_Linux/input.c @@ -10,17 +10,21 @@ char* readWord(FILE *file) int index = 0; // Position im Puffer 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 + // Whitespace und Delimiters überspringen + while((c = fgetc(file)) != EOF && (isspace(c) || c == ',' || c == ';' || c == '.')); - // Buchstaben einlesen bis nächstes whitespace/EOF - while(c != EOF && !isspace(c) && index < MAX_WORD_LEN - 1) // -1 wegen Nullterminator + // Buchstaben einlesen bis nächstes whitespace/Delimiter/EOF + while(c != EOF && !isspace(c) && c != ',' && c != ';' && c != '.' && index < MAX_WORD_LEN - 1) //-1 wegen Nullterminator { - word[index++] = (char)c; + word[index++] = (char)toupper(c); // Konvertiere zu Großbuchstaben c = fgetc(file); } word[index] = '\0'; // Nullterminator (= Ende String) + // Leere überspringen + if(index == 0) + return NULL; + return strdup(word); // Rückgabe string, dynamisch allokiert da Zeiger auf lokalen Puffer zurückgegeben } diff --git a/Start_Linux/input.o b/Start_Linux/input.o index 8d2710d..d85fd7b 100644 Binary files a/Start_Linux/input.o and b/Start_Linux/input.o differ diff --git a/Start_Linux/makefile b/Start_Linux/makefile index 8108b58..60c75f3 100644 --- a/Start_Linux/makefile +++ b/Start_Linux/makefile @@ -9,8 +9,8 @@ unityfolder = ./unity # -------------------------- # initiales Spiel bauen # -------------------------- -wordsalad_initial: - $(CC) -o wordsalad_ourversion -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) +wordsalad_ourversion: + $(CC) -o wordsalad_ourversion -L. $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS) # -------------------------- # Normales Spiel bauen diff --git a/Start_Linux/runTests b/Start_Linux/runTests new file mode 100755 index 0000000..e363e0d Binary files /dev/null and b/Start_Linux/runTests differ