Compare commits

..
2 Commits
Author SHA1 Message Date
deschnerja104273 117d041da2 Vervollständigung weniger Kommentare in game und input 2026-10-23 10:44:49 +02:00
dehmfl103364 38864ec511 Finale Aenderungen 2026-10-16 20:49:28 +02:00
4 changed files with 11 additions and 3 deletions

No files matched your search

+2 -1
View File
@@ -6,6 +6,7 @@
#define MAX_RAND_TRIES_PER_WORD 10
#define EMPTY_CHAR 0
// Funktion die eine zufällige Zahl von 0-range zurückgibt
int randomNumberInRange(unsigned int range);
//TODO: Spiellogik implementieren:
@@ -26,7 +27,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
}
}
// Schleife bis alle Wörter durchlaufen
for (int wordToBePlaced = 0; wordToBePlaced < wordCount; wordToBePlaced++) {
int triesPerWord = 1;
while (triesPerWord <= MAX_RAND_TRIES_PER_WORD) {
+1 -1
View File
@@ -20,7 +20,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
strcpy(words[wordsRead],token);
//Kleinbuchstaben -> Grossbuchstaben
int len = strlen(words[wordsRead]);
for(int i = 0; i < len; i++){ //müsste einen kleinbustaben am ende haben
for(int i = 0; i < len; i++){
if(islower(words[wordsRead][i])){
words[wordsRead][i] = toupper(words[wordsRead][i]);
}
+6 -1
View File
@@ -40,7 +40,12 @@ int main(int argc, char *argv[])
// Check if all words were successfully placed
// Start the game if successful
// error message if some words couldn't be placed
if(wordCount == placedWords){
startGame(wordSalad,SALAD_SIZE,words,wordCount,800);
}else{
printf("error. not enough words could be placed");
return 0;
}
}
else
{
+2
View File
@@ -29,6 +29,8 @@ wordsalad_initial:
my_wordsalad_input: input.o $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a
$(CC) $(CFLAGS) -o my_wordsalad_input input.o $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS)
final_wordsalad: main.o game.o input.o $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a
$(CC) $(CFLAGS) -o final_wordsalad main.o game.o input.o $(BINARIES)/libraylib.a $(LDFLAGS) $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS)
# --------------------------