Template
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b4ef70452 |
No files matched your search
+5
-1
@@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
//TODO: Spiellogik implementieren:
|
//TODO: Spiellogik implementieren:
|
||||||
/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren
|
/* * Wörter aus der Wortliste zufällig horizontal oder vertikal platzieren
|
||||||
* restliche Felder mit zufälligen Buchstaben füllen */
|
* restliche Felder mit zufälligen Buchstaben füllen
|
||||||
|
Idee: COunt von oben nach unten laufen zu lassen wenn möglich oder wie bei read datei
|
||||||
|
habe nxn Matrix. Muss buchgstaben von oben nach unten und rechts nach links
|
||||||
|
zufällig wörter per a[rand] rand zwischen x und y asuwählen
|
||||||
|
ausrichtung evtl mit wort ist abhängig von nur i und j = x 0oder anders rum */
|
||||||
|
|
||||||
// Creates the word salad by placing words randomly and filling empty spaces
|
// Creates the word salad by placing words randomly and filling empty spaces
|
||||||
int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount)
|
int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], unsigned int wordCount)
|
||||||
|
|||||||
@@ -8,5 +8,15 @@
|
|||||||
// Read words from file and store in 'words' array
|
// Read words from file and store in 'words' array
|
||||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||||
{
|
{
|
||||||
|
if (file == 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
while(count < maxWordCount && scanf(file, %99s, words[count]) == 1){
|
||||||
|
|
||||||
|
count++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user