game
This commit is contained in:
parent
0d192b71fd
commit
f9da187cb2
@ -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
BIN
Start_Windows/input.o
Normal file
Binary file not shown.
19
game.c
19
game.c
@ -70,21 +70,22 @@ 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++)
|
||||
{
|
||||
for (unsigned int j = 0; j < searchFieldLen; j++)
|
||||
|
||||
//Leere Felder mit Zufallsbuchstaben füllen
|
||||
for (unsigned int i = 0; i < searchFieldLen; i++)
|
||||
{
|
||||
if (salad[i][j] == EMPTY_CHAR)
|
||||
salad[i][j] = 'A' + rand() % 26;
|
||||
}
|
||||
for (unsigned int j = 0; j < searchFieldLen; j++)
|
||||
{
|
||||
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++)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user