einfach nur kosmetische Änderungen
This commit is contained in:
parent
42739dc5cc
commit
36c61ff8e7
@ -34,9 +34,9 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
char *word = readWord(file);
|
char *word = readWord(file);
|
||||||
if(word != NULL)
|
if(word != NULL)
|
||||||
{
|
{
|
||||||
strncpy(words[count], word, MAX_WORD_LEN - 1); // Wort in Array kopieren
|
strncpy(words[count], word, MAX_WORD_LEN - 1); // Wort in Array kopieren
|
||||||
words[count][MAX_WORD_LEN - 1] = '\0'; // Sicherstellen, dass String nullterminiert ist
|
words[count][MAX_WORD_LEN - 1] = '\0'; // Sicherstellen, dass String nullterminiert ist
|
||||||
free(word); // Dynamisch allokierten Speicher freigeben
|
free(word); // Dynamisch allokierten Speicher freigeben
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,10 +31,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Read words from file and store in 'words' array
|
// Read words from file and store in 'words' array
|
||||||
wordCount = readWords(file, words, MAX_NUMBER_OF_WORDS);
|
wordCount = readWords(file, words, MAX_NUMBER_OF_WORDS);
|
||||||
fclose(file); // TODO:
|
fclose(file);
|
||||||
// Check if all words were successfully placed
|
|
||||||
// Start the game if successful
|
|
||||||
// error message if some words couldn't be placed
|
// TODO:
|
||||||
|
// Check if all words were successfully placed
|
||||||
|
// Start the game if successful
|
||||||
|
// error message if some words couldn't be placed
|
||||||
|
|
||||||
|
|
||||||
// Create the word salad by placing words into grid
|
// Create the word salad by placing words into grid
|
||||||
@ -42,7 +45,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if(placedWords==wordCount)
|
if(placedWords==wordCount)
|
||||||
{
|
{
|
||||||
// Start the graphical game with the created word salad and the list of words
|
// Spiel starten, mit dem erstellten wordSalad, der Anzahl der Wörter und der Liste der Wörter
|
||||||
startGame(wordSalad, SALAD_SIZE, words, wordCount, 800);
|
startGame(wordSalad, SALAD_SIZE, words, wordCount, 800);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user