generated from freudenreichan/info2Praktikum-Wortsalat
fixed bugs occurring with the macro function in game
This commit is contained in:
parent
e135756db5
commit
34e5f347ef
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user