generated from freudenreichan/info2Praktikum-Wortsalat
funktion showWordSalad ergänzt, fehler in placeRandomLetters korrigiert
This commit is contained in:
parent
f407d5a36f
commit
2f625c98b9
@ -128,8 +128,6 @@ void placeRandomLetters(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
|
|||||||
for (i = 0; i < searchFieldLen; i++)
|
for (i = 0; i < searchFieldLen; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; i < searchFieldLen; j++)
|
for (j = 0; i < searchFieldLen; j++)
|
||||||
{
|
|
||||||
if (salad[i][j])
|
|
||||||
{
|
{
|
||||||
if ((salad[i][j] < 'A') && (salad[i][j] > 'z'))
|
if ((salad[i][j] < 'A') && (salad[i][j] > 'z'))
|
||||||
{
|
{
|
||||||
@ -138,7 +136,6 @@ void placeRandomLetters(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Creates the word salad by placing words randomly and filling empty spaces
|
// Creates the word salad by placing words randomly and filling empty spaces
|
||||||
@ -179,6 +176,17 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
|||||||
// Prints the word salad to console
|
// 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)
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
|
||||||
|
|
||||||
|
for (i = 0; i < searchFieldLen; i++)
|
||||||
|
{
|
||||||
|
for (j = 0; i < searchFieldLen; j++)
|
||||||
|
{
|
||||||
|
printf("%c", salad[i][j]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user