From 99a0600fd2093f62611f7a91e1c2bb575184d66e Mon Sep 17 00:00:00 2001 From: Alexei Date: Mon, 10 Nov 2025 12:54:14 +0100 Subject: [PATCH] test 20 --- Start_Windows/main.c | 20 +++++++++----------- Start_Windows/testwords_delims.txt | 1 + Start_Windows/testwords_empty.txt | 0 Start_Windows/testwords_simple.txt | 3 +++ 4 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 Start_Windows/testwords_delims.txt create mode 100644 Start_Windows/testwords_empty.txt create mode 100644 Start_Windows/testwords_simple.txt diff --git a/Start_Windows/main.c b/Start_Windows/main.c index ed129e6..2432b34 100644 --- a/Start_Windows/main.c +++ b/Start_Windows/main.c @@ -36,21 +36,19 @@ int main(int argc, char *argv[]) // Create the word salad by placing words into grid placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount); - // TODO: + // TODO: (if Schleife implementieren, die das prüft) // Check if all words were successfully placed - if(wordCount == placedWords) - { - exitCode = EXIT_SUCCESS; - startGame(wordSalad,SALAD_SIZE, words,wordCount,750); - } - else - { - exitCode = EXIT_FAILURE; - printf("Bei der Platzierung ist etwas falsch gelaufen!"); - } // Start the game if successful // error message if some words couldn't be placed + if (placedWords == wordCount){ + showWordSalad(wordSalad, placedWords); + } + else{ + printf("Error. The words couldn't be placed.\n"); + return -1; + } + } else { diff --git a/Start_Windows/testwords_delims.txt b/Start_Windows/testwords_delims.txt new file mode 100644 index 0000000..e721fce --- /dev/null +++ b/Start_Windows/testwords_delims.txt @@ -0,0 +1 @@ +Hund,Katze; Maus diff --git a/Start_Windows/testwords_empty.txt b/Start_Windows/testwords_empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/Start_Windows/testwords_simple.txt b/Start_Windows/testwords_simple.txt new file mode 100644 index 0000000..37d7524 --- /dev/null +++ b/Start_Windows/testwords_simple.txt @@ -0,0 +1,3 @@ +Apfel +Banane +Kiwi \ No newline at end of file