diff --git a/Start_Mac/game.c b/Start_Mac/game.c index 300cb6d..afe388a 100644 --- a/Start_Mac/game.c +++ b/Start_Mac/game.c @@ -23,14 +23,15 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi const int anzahlBuchstaben = 26; for (int i = 0; i < wordCount; i++) { - int vertikal_horizontal = rand() % 2; //1 = vertikal //0 = horizontal + typedef enum {VERTIKAL, HORIZONTAL} Richtung; + Richtung vertikal_horizontal = rand() % 2; //1 = vertikal //0 = horizontal int leange = strlen(words[i]); int positionX = 0; int positionY = 0; int voll = 0; int tries = 0; - if (vertikal_horizontal == 1) { + if (vertikal_horizontal == VERTIKAL) { tries = 0; do { @@ -52,7 +53,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi } else if (voll == 1) printf("Das Wort '%s' konnte nicht plaziert werden", words[i]); - } else if (vertikal_horizontal == 0) { + } else if (vertikal_horizontal == HORIZONTAL) { tries = 0; do { diff --git a/Start_Mac/game.o b/Start_Mac/game.o index 4bf5def..6d3f9e2 100644 Binary files a/Start_Mac/game.o and b/Start_Mac/game.o differ diff --git a/Start_Mac/input.c b/Start_Mac/input.c index 5d07104..8271f26 100644 --- a/Start_Mac/input.c +++ b/Start_Mac/input.c @@ -32,7 +32,10 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) } //hier müsste man den token string in großbuchstaben formatieren - + for (int i = 0; i < strlen(token); i++) + { + token[i] = toupper(token[i]); + } strncpy(words[count], token, MAX_WORD_LEN-1); words[count][MAX_WORD_LEN-1] = '\0'; diff --git a/Start_Mac/input.o b/Start_Mac/input.o index 616d98a..6d0cf75 100644 Binary files a/Start_Mac/input.o and b/Start_Mac/input.o differ diff --git a/Start_Mac/wordsalad b/Start_Mac/wordsalad index 17ebaeb..769a27d 100755 Binary files a/Start_Mac/wordsalad and b/Start_Mac/wordsalad differ