alles bis auf makefile

This commit is contained in:
yannick 2025-11-03 21:52:37 +01:00
parent 5e77016df3
commit ad5a4de563

View File

@ -6,8 +6,7 @@
#define MAX_NUMBER_OF_WORDS 100
#define SALAD_SIZE 20
#define WINDOW_SIZE 800 // Fenstergröße für das grafische Spiel
int main(int argc, char *argv[])
{
@ -38,11 +37,26 @@ int main(int argc, char *argv[])
// Create the word salad by placing words into grid
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
// 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("All %u words successfully placed!\n\n", placedWords);
// Show the generated word salad on console
showWordSalad(wordSalad, SALAD_SIZE);
// Start the graphical game (raylib-basierte Version)
printf("\nStarting graphical word search game ...\n");
startGame(wordSalad, SALAD_SIZE, words, wordCount, WINDOW_SIZE);
}
else
{
fprintf(stderr,
"Error: Only %u of %u words could be placed.\n"
"Please reduce the number of words or increase the grid size.\n",
placedWords, wordCount);
exitCode = EXIT_FAILURE;
}
}
else
{
@ -53,4 +67,5 @@ int main(int argc, char *argv[])
}
return exitCode;
}