Makefile überarbeitet; readWords() implementiert; createWordSalad implementiert; main.c fertiggestellt und unsere Namen zu words.txt hinzugefügt

This commit is contained in:
schuhmannlo105927 committed 2026-11-03 10:38:52 +01:00
1 parent f2e54529a4
commit fb760d76fe
5 files changed
+111 -9

No files matched your search

+11
View File
@@ -3,6 +3,7 @@
#include "input.h"
#include "game.h"
#include "graphicalGame.h"
#include <time.h>
#define MAX_NUMBER_OF_WORDS 100
#define SALAD_SIZE 20
@@ -10,6 +11,7 @@
int main(int argc, char *argv[])
{
int exitCode = EXIT_SUCCESS;
srand(time(NULL));
// Check if the correct number of arguments is provided
if(argc != 2)
@@ -36,6 +38,15 @@ int main(int argc, char *argv[])
// Create the word salad by placing words into grid
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
if (placedWords == wordCount)
{
startGame(wordSalad, SALAD_SIZE, words, wordCount, 100);
} else {
fprintf(stderr, "Es konnten nicht alle Wörter platziert werden :(\n");
exitCode = EXIT_FAILURE;
}
// TODO:
// Check if all words were successfully placed
// Start the game if successful