This commit is contained in:
Mihaela Creciun committed 2026-10-29 10:18:53 +01:00
commit ed3b2e797c
3 files changed
+15 -34

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# Wortsalat Projekt
Ein GeneDas Programm liest eine Liste von Wörtern aus einer übergebenen Textdatei (z.B. `words.txt`), versteckt diese zufällig in einem Raster und füllt die restlichen leeren Felder mit zufälligen Buchstaben auf, sodass ein Wortsuchrätsel entsteht.
Code frisch bauen
make clean
make wordsalad_myversion
Das Spiel starten
./wordsalad_myversion words.txt
Uni-Tests ausführen
make test
./runTests
+1 -1
View File
@@ -3,7 +3,7 @@
#include "input.h"
#define MAX_SEARCH_FIELD_LEN 20
#define MAX_SEARCH_FIELD_LEN 100
int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount);
-33
View File
@@ -1,33 +0,0 @@
#include <stdio.h>
#include "graphicalGame.h"
#include "game.h"
int main(void)
{
char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN];
char words[][MAX_WORD_LEN] = {
"HALLO",
"WELT",
"AUTO",
"BIRNE",
"APFEL",
"BANANE",
"LANGESWORT",
"REITSPORT",
"APFELBAUM",
"DRACULA",
"LAPTOP",
"BILDSCHRIM",
"HAUS"
};
unsigned int wordCount = sizeof(words) / sizeof(words[0]);
int placedWords = createWordSalad(salad, MAX_SEARCH_FIELD_LEN, words, wordCount);
startGame(salad, MAX_SEARCH_FIELD_LEN, words, wordCount, 1000);
printf("Placed words: %d\n", placedWords);
return 0;
}