diff --git a/.gitignore b/.gitignore index 0fbd721..685a45e 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,6 @@ dkms.conf # macOS .DS_Store +Startcode/testwords_delims.txt +Startcode/testwords_empty.txt +Startcode/testwords_simple.txt diff --git a/Startcode/game.c b/Startcode/game.c index fdd4999..6568e5d 100644 --- a/Startcode/game.c +++ b/Startcode/game.c @@ -6,10 +6,7 @@ #define MAX_RAND_TRIES_PER_WORD 10 #define EMPTY_CHAR 0 -typedef enum Richtung { - VERTIKAL = 0; - HORIZONTAL = 1; -}; + //TODO: Spiellogik implementieren: /* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren @@ -51,7 +48,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi int dir = rand() % 2; if ((MAX_SEARCH_FIELD_LEN - x) < len){ - if((MAX_SEARCH_FIELD_LEN - )y < len){ + if((MAX_SEARCH_FIELD_LEN - y) < len){ // cant place word here (too far in the bottom right corner) try++; continue; @@ -59,7 +56,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi } //place word vertically - if(dir == HORIZONTAL){ + if(dir == 1){ //see if all neccessary spaces are empty bool cont = false; for (int i = 0; i < (int)len; i++){