This commit is contained in:
Helena Köhler 2025-11-04 19:01:22 +01:00
parent 0d192b71fd
commit f9da187cb2
3 changed files with 11 additions and 10 deletions

View File

@ -33,7 +33,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
//Speichere das Wort im Array, falls es nicht leer ist
if (len > 0){
//Wandel das Wort in Großbuchstaben um
for (size_t = 0; i < len; i++ ){
for (size_t i = 0; i < len; i++ ){
token[i] = toupper ((unsigned char)token[i]);
}
strncpy(words[word_count], token, MAX_WORD_LEN -1);

BIN
Start_Windows/input.o Normal file

Binary file not shown.

5
game.c
View File

@ -70,7 +70,7 @@ unsigned int erfolgreichGesetzt = 0;
fprintf(stderr, "Warnung: Konnte Wort nicht platzieren: %s\n", words[w]);
}
}
//Leere Felder mit Zufallsbuchstaben füllen
for (unsigned int i = 0; i < searchFieldLen; i++)
{
@ -79,12 +79,13 @@ for (unsigned int i = 0; i < searchFieldLen; i++)
if (salad[i][j] == EMPTY_CHAR)
salad[i][j] = 'A' + rand() % 26;
}
return erfolgreichGesetzt;
}
// Prints the word salad to console
void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen)
void showWordSalad(const char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen);
{
for (unsigned int i = 0; i < searchFieldLen; i++){
for (unsigned int j = 0; j < searchFieldLen; j++)