diff --git a/Start_Windows/game.c b/Start_Windows/game.c index d8cc133..2772b71 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -2,6 +2,7 @@ #include #include #include +#include #define MAX_RAND_TRIES_PER_WORD 10 #define EMPTY_CHAR 0 @@ -19,5 +20,19 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi // Prints the word salad to console void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen) { - + if(searchFieldLen <= MAX_SEARCH_FIELD_LEN) + { + for(int i = 0; i < searchFieldLen; i++) + { + for(int j = 0; j < searchFieldLen; j++) + { + putchar(salad[i][j]);//Prints a letter within the salad array + } + putchar(10);//Prints a Line Feed, thus ensuring the correct formatting of the program + } + } + else + { + puts("FEHLER! Buchstabenfeld uebersteigt Maximalzahl der Buchstaben!"); + } }