From 6f176e51aadb2f4a2f9dcab6bc5605c44a01bb41 Mon Sep 17 00:00:00 2001 From: manusmac Date: Tue, 28 Oct 2025 13:35:49 +0100 Subject: [PATCH] showWordsalad Funktion in Start_Windows --- Start_Mac/main.c | 4 +--- Start_Windows/game.c | 9 ++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Start_Mac/main.c b/Start_Mac/main.c index 9a98d80..0175942 100644 --- a/Start_Mac/main.c +++ b/Start_Mac/main.c @@ -42,9 +42,7 @@ int main(int argc, char *argv[]) if(placedWords == wordCount) { // Start the game if successful - printf("All %u words were successfully placed in the word salad!\n", wordCount); - createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); - showWordSalad(wordSalad, SALAD_SIZE); + startGame(wordSalad,SALAD_SIZE,words,wordCount,SALAD_SIZE); } else { diff --git a/Start_Windows/game.c b/Start_Windows/game.c index d8cc133..60ef3b3 100644 --- a/Start_Windows/game.c +++ b/Start_Windows/game.c @@ -19,5 +19,12 @@ 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) { - + for (int i=0; i < searchFieldLen; i++) { + for (int j=0; j < searchFieldLen; j++) { + printf("$c",salad[i][j]); + printf(" "); + } + printf ("\n"); + } } +