funktion showWordSalad ergänzt, fehler in placeRandomLetters korrigiert

This commit is contained in:
Jonas Hofmann 2025-10-25 21:45:56 +02:00
parent f407d5a36f
commit 2f625c98b9

View File

@ -128,8 +128,6 @@ void placeRandomLetters(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
for (i = 0; i < searchFieldLen; i++)
{
for (j = 0; i < searchFieldLen; j++)
{
if (salad[i][j])
{
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
@ -179,6 +176,17 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
// Prints the word salad to console
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");
}
}