Merge branch 'nico'

This commit is contained in:
2025-10-21 15:11:09 +02:00
10 changed files with 64 additions and 21 deletions
+9 -1
View File
@@ -14,10 +14,18 @@
int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount)
{
}
// 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]);
}
}
}
+10 -3
View File
@@ -38,13 +38,20 @@ int main(int argc, char *argv[])
// TODO:
// Check if all words were successfully placed
// Start the game if successful
// error message if some words couldn't be placed
if(placedWords == wordCount)
{
printf("Eingabe war erfolgreich!\nDas Spiel beginnt:");
void startGame(wordSalad, searchFieldSize, words, numberOfWords, windowSize);
}
else
{
printf("Fehler! Es konnten nicht alle Woerter hinzugefuegt werden!\n Bitte Spiel neustarten!");
}
}
else
{
// Print error message if file couldn't be opened
fprintf(stderr, "Could not open file %s for reading ...\n", argv[1]);
exitCode = EXIT_FAILURE;
}