generated from freudenreichan/info2Praktikum-Wortsalat
newest version
This commit is contained in:
commit
5be8b48bd2
4 files changed
+5
-5
No files matched your search
+2
-3
@@ -27,9 +27,8 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
|||||||
maxLength = findmaxLength(words, wordCount);
|
maxLength = findmaxLength(words, wordCount);
|
||||||
// Size of Field!
|
// Size of Field!
|
||||||
if (searchFieldLen < maxLength)
|
if (searchFieldLen < maxLength)
|
||||||
sizeOfField = maxLength;
|
return returnValue;
|
||||||
else
|
sizeOfField = searchFieldLen;
|
||||||
sizeOfField = searchFieldLen;
|
|
||||||
initializeField(sizeOfField, salad);
|
initializeField(sizeOfField, salad);
|
||||||
// for all words put them in
|
// for all words put them in
|
||||||
for (unsigned int i = 0; i < wordCount; i++){
|
for (unsigned int i = 0; i < wordCount; i++){
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
// Read words from file and store in 'words' array
|
// Read words from file and store in 'words' array
|
||||||
static int createSingleWords(char text[MAX_LINE_LEN], char words[][MAX_WORD_LEN], unsigned int maxWordCount);
|
static int createSingleWords(char text[MAX_LINE_LEN], char words[][MAX_WORD_LEN], unsigned int maxWordCount);
|
||||||
|
|
||||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
unsigned int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
||||||
{
|
{
|
||||||
int wordCount = 0;
|
int wordCount = 0;
|
||||||
char lineRead[MAX_LINE_LEN];
|
char lineRead[MAX_LINE_LEN];
|
||||||
|
|||||||
+1
-1
@@ -6,6 +6,6 @@
|
|||||||
#define MAX_WORD_LEN 100
|
#define MAX_WORD_LEN 100
|
||||||
#define MAX_LINE_LEN 1024
|
#define MAX_LINE_LEN 1024
|
||||||
|
|
||||||
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount);
|
unsigned int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -47,6 +47,7 @@ int main(int argc, char *argv[])
|
|||||||
// Start the game if successful
|
// Start the game if successful
|
||||||
// error message if some words couldn't be placed
|
// error message if some words couldn't be placed
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user