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/Start_Windows.iml b/Start_Windows/.idea/Start_Windows.iml new file mode 100644 index 0000000..4c94235 --- /dev/null +++ b/Start_Windows/.idea/Start_Windows.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Start_Windows/.idea/editor.xml b/Start_Windows/.idea/editor.xml new file mode 100644 index 0000000..1f0ef49 --- /dev/null +++ b/Start_Windows/.idea/editor.xml @@ -0,0 +1,580 @@ + + + + + \ No newline at end of file diff --git a/Start_Windows/.idea/modules.xml b/Start_Windows/.idea/modules.xml new file mode 100644 index 0000000..79fea45 --- /dev/null +++ b/Start_Windows/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ 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 d8cc133..d196cc4 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -13,7 +13,10 @@ // Creates the word salad by placing words randomly and filling empty spaces int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount) { - + srand(time(NULL)); + int index_x = rand()%MAX_SEARCH_FIELD_LEN; + int index_y = rand()%MAX_SEARCH_FIELD_LEN; + // } // Prints the word salad to console diff --git a/Start_Windows/game.o b/Start_Windows/game.o new file mode 100644 index 0000000..5a14299 Binary files /dev/null and b/Start_Windows/game.o differ diff --git a/Start_Windows/graphicalGame.c b/Start_Windows/graphicalGame.c index fc648b6..1cfde80 100644 --- a/Start_Windows/graphicalGame.c +++ b/Start_Windows/graphicalGame.c @@ -1,8 +1,7 @@ #include #include - #include "graphicalGame.h" -#include "raylib.h" +#include "C:\Git\info2Praktikum-Wortsalat\Start_Windows\raylib\raylib.h" #define MAX_MESSAGE_LEN 256 #define MAX_SOLUTION_WORD_LEN 16 diff --git a/Start_Windows/input.c b/Start_Windows/input.c index ed77805..f096318 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -8,5 +8,21 @@ // Read words from file and store in 'words' array int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { + int counter = 0; //word's numbers + char line[MAX_WORD_LEN]; + char *word; + while (fgets(line, MAX_LINE_LEN, file) != NULL && counter < maxWordCount) { + //printf("%s", line); + word = strtok(line, " ,;"); + while (word != NULL && counter < maxWordCount) + { + strcpy(words[counter++], word); + //printf ("%s\n",word); + word = strtok (NULL, " ,;"); + } + } + //printf("\n %d", counter); + + 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..b8aaf2d Binary files /dev/null and b/Start_Windows/input.o differ diff --git a/Start_Windows/runTests.exe b/Start_Windows/runTests.exe new file mode 100644 index 0000000..5fd57ed Binary files /dev/null and b/Start_Windows/runTests.exe differ diff --git a/Start_Windows/unit_tests.c b/Start_Windows/unit_tests.c index 34b07ed..e225387 100644 --- a/Start_Windows/unit_tests.c +++ b/Start_Windows/unit_tests.c @@ -1,7 +1,7 @@ #include #include #include -#include "unity.h" +#include "C:\Git\info2Praktikum-Wortsalat\Start_Windows\unity\unity.h" #include "input.h" #include "game.h" diff --git a/Start_Windows/wordsalad_initial.exe b/Start_Windows/wordsalad_initial.exe new file mode 100644 index 0000000..dfcba7a Binary files /dev/null and b/Start_Windows/wordsalad_initial.exe differ