diff --git a/Start_Windows/game.c b/Start_Windows/game.c index 5a3a56b..6d2a2ce 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -7,7 +7,7 @@ #define MAX_RAND_TRIES_PER_WORD 10 #define EMPTY_CHAR 0 -#define RANDOMNUMBER(minimum, maximum) rand() % (maximum – minimum + 1) + minimum //Macro to generate a Number between minimum and maximum (both are possibly rolled) +#define RANDOMNUMBER(minimum, maximum) ((rand() % ((maximum)-(minimum)+1))+cd minimum) //Macro to generate a Number between minimum and maximum (both are possibly rolled) //TODO: Spiellogik implementieren: /* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren --> Vorher eingabe festlegen! @@ -34,8 +34,10 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi { for(int j = 0; j < searchFieldLen; j++) { - if((salad[i][j] == 63)//checks if there is already a letter of a word placed in here + if((salad[i][j] == 63))//checks if there is already a letter of a word placed in here + { salad[i][j] = RANDOMNUMBER(65, 90);//fills "empty" chars in word salad with a random upper case letter + } } } } diff --git a/Start_Windows/input.c b/Start_Windows/input.c index 3f100f3..949ef93 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -8,5 +8,4 @@ // Read words from file and store in 'words' array int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { - }