showWordsalad Funktion in Start_Windows

This commit is contained in:
Manuel Nitsche 2025-10-28 13:35:49 +01:00
parent 95592836b6
commit 6f176e51aa
2 changed files with 9 additions and 4 deletions

View File

@ -42,9 +42,7 @@ int main(int argc, char *argv[])
if(placedWords == wordCount) if(placedWords == wordCount)
{ {
// Start the game if successful // Start the game if successful
printf("All %u words were successfully placed in the word salad!\n", wordCount); startGame(wordSalad,SALAD_SIZE,words,wordCount,SALAD_SIZE);
createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
showWordSalad(wordSalad, SALAD_SIZE);
} }
else else
{ {

View File

@ -19,5 +19,12 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
// Prints the word salad to console // Prints the word salad to console
void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen) 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");
}
} }