diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..963c96f --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,344 @@ + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..2a4c208 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8897478 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Start_Windows/.idea/.gitignore b/Start_Windows/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/Start_Windows/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/Start_Windows/.idea/editor.xml b/Start_Windows/.idea/editor.xml new file mode 100644 index 0000000..ead1d8a --- /dev/null +++ b/Start_Windows/.idea/editor.xml @@ -0,0 +1,248 @@ + + + + + \ No newline at end of file diff --git a/Start_Windows/.idea/misc.xml b/Start_Windows/.idea/misc.xml new file mode 100644 index 0000000..53624c9 --- /dev/null +++ b/Start_Windows/.idea/misc.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/Start_Windows/.idea/vcs.xml b/Start_Windows/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Start_Windows/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Start_Windows/game.c b/Start_Windows/game.c index e6064aa..e64a938 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -26,8 +26,16 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi int placedWords = 0; int countTrys = 0; + + for (int q = 0; q < 20; q++) { + for (int w = 0; w < 20; w++) { + salad[q][w] = EMPTY_CHAR; + } + } + //Jedes Wort einzeln durchgehen for (int i = 0; i < wordCount; i++) { + noFreigabe = 1; laenge = strlen(words[i]); //Vertikal oder Horizontal, Vertikal = 0; Horizontal = 1; VerHor = rand() % 2; @@ -58,8 +66,10 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi if (noFreigabe == 0) { for (int j = 0; j < laenge; j++) { salad[startPositionVer][startPositionHor + j] = words[i][j]; + } placedWords++; + countTrys = 0; } @@ -97,10 +107,10 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi for (int i = 0; i < searchFieldLen; i++) { for (int j = 0; j < searchFieldLen; j++) { if (salad[i][j] == EMPTY_CHAR) - salad[i][j] = ' ';// + (rand() % 26); + salad[i][j] = 'A' + (rand() % 26); } } - showWordSalad(salad, searchFieldLen); + showWordSalad(salad, searchFieldLen); return placedWords; } diff --git a/Start_Windows/game.o b/Start_Windows/game.o new file mode 100644 index 0000000..d12e45f 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..d210526 Binary files /dev/null and b/Start_Windows/graphicalGame.o differ diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 4fa81a7..118686f 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -12,22 +12,25 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) int anzahlWord = 0; while (fgets(zeile, MAX_LINE_LEN, file)) { - char *teiler = " .,;"; - char *token = strtok(zeile, teiler); + char *teiler = " .,;\t\r\n"; + char *token; + token = strtok(zeile, teiler); + while (token != NULL && anzahlWord < maxWordCount) { strncpy(words[anzahlWord], token, MAX_WORD_LEN - 1); + //printf("%s\n", words[anzahlWord]); words[anzahlWord][MAX_WORD_LEN - 1] = '\0'; anzahlWord++; token = strtok(NULL, teiler); } } - /*Alle Buchstaben zu Großbuchstaben umwandeln - *h + //Alle Buchstaben zu Großbuchstaben umwandeln + for (int i = 0; i < anzahlWord; i++) { int laenge = strlen(words[i]); for (int j = 0; j < laenge; j++) words[i][j] = toupper(words[i][j]); } - */ + return anzahlWord; } \ No newline at end of file diff --git a/Start_Windows/input.o b/Start_Windows/input.o new file mode 100644 index 0000000..4150962 Binary files /dev/null and b/Start_Windows/input.o differ diff --git a/Start_Windows/main.c b/Start_Windows/main.c index a012dd6..d358b9b 100644 --- a/Start_Windows/main.c +++ b/Start_Windows/main.c @@ -23,6 +23,8 @@ int main(int argc, char *argv[]) unsigned int wordCount = 0; FILE *file = fopen(argv[1], "r"); + printf("File %s\n", argv[1]); + //FILE *file = fopen(words, "r"); if(file != NULL) { diff --git a/Start_Windows/main.o b/Start_Windows/main.o new file mode 100644 index 0000000..cdb0cf6 Binary files /dev/null and b/Start_Windows/main.o differ diff --git a/Start_Windows/makefile b/Start_Windows/makefile index 690d691..9abc186 100644 --- a/Start_Windows/makefile +++ b/Start_Windows/makefile @@ -7,7 +7,7 @@ raylib_folder = ./raylib unityfolder = ./unity # -------------------------- -# initiales Spiel bauen +# initiales Spiel bafuen # -------------------------- wordsalad_initial: $(CC) -o wordsalad_initial $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) diff --git a/Start_Windows/wordsalad.exe b/Start_Windows/wordsalad.exe new file mode 100644 index 0000000..fe1fed1 Binary files /dev/null and b/Start_Windows/wordsalad.exe differ diff --git a/Start_Windows/wordsalad_myversion.exe b/Start_Windows/wordsalad_myversion.exe new file mode 100644 index 0000000..26c9b0b Binary files /dev/null and b/Start_Windows/wordsalad_myversion.exe differ