diff --git a/Start_Windows/game.o b/Start_Windows/game.o new file mode 100644 index 0000000..1db69c1 Binary files /dev/null and b/Start_Windows/game.o differ diff --git a/Start_Windows/graphicalGame.o b/Start_Windows/graphicalGame.o new file mode 100644 index 0000000..882f85b Binary files /dev/null and b/Start_Windows/graphicalGame.o differ diff --git a/Start_Windows/input.c b/Start_Windows/input.c index ed77805..236fbf4 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -8,5 +8,30 @@ // Read words from file and store in 'words' array int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { + // MAX_WORD_LEN 100 + // MAX_LINE_LEN 1024 + // *file ist Datei + // words ist Array + // MAX_WORD_LEN ist maximale Wortlänge + // maxWordCount ist maximale Anzahl an Wörtern + char puffer[MAX_LINE_LEN]; + int counter = 0; + while(fgets(puffer, MAX_LINE_LEN-1, file) != NULL && counter < maxWordCount) + { + char *parts = strtok(puffer, ",;/n/t. "); + + while(parts != NULL && counter < maxWordCount) + { + //strncpy(words[counter][MAX_WORD_LEN], puffer, MAX_LINE_LEN-1); + //words[counter][MAX_WORD_LEN-1] = "\0"; + //Großbuchstaben + for(int i = 0; i < MAX_WORD_LEN -1 && parts[i] != '\0'; i++) + words[counter][i] = toupper(parts[i]); + } + counter++; + parts = strtok(NULL, ",;/n/t. "); + + } + return counter; } \ No newline at end of file diff --git a/Start_Windows/input.o b/Start_Windows/input.o new file mode 100644 index 0000000..86299a0 Binary files /dev/null and b/Start_Windows/input.o differ diff --git a/Start_Windows/main.o b/Start_Windows/main.o new file mode 100644 index 0000000..599acbb Binary files /dev/null and b/Start_Windows/main.o differ diff --git a/Start_Windows/makefile b/Start_Windows/makefile index 7548333..1433eb5 100644 --- a/Start_Windows/makefile +++ b/Start_Windows/makefile @@ -47,4 +47,4 @@ clean: #hier eigene wordsalad kopieren, library rauslassen wordsalad_myversion: main.o input.o game.o graphicalGame.o $(BINARIES)/libwordsalad.a - $(CC) $(CFLAGS) -o wordsalad_myversion main.o input.o game.o graphicalGame.o $(BINARIES)/libwordsalad.a $(LDFLAGS) \ No newline at end of file + $(CC) $(CFLAGS) -o wordsalad_myversion main.o input.o game.o graphicalGame.o $(BINARIES)/libwordsalad.a $(LDFLAGS) \ No newline at end of file