Seed erzeugen korigieren

This commit is contained in:
Timo Hertel 2025-10-27 14:23:36 +01:00
parent 5ba22a1fa8
commit cf09c5233a
3 changed files with 24 additions and 6 deletions

View File

@ -86,7 +86,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
if (y + wordLength > searchFieldLen) continue; if (y + wordLength > searchFieldLen) continue;
//Prüfen ob kein anderes Wort im Weg //Prüfen ob kein anderes Wort im Weg
int fits = 1; int fits = 1;
for (int i = 0; i < wordLength; i++) for (int i = 0; i < wordLength; i++)
{ {
if (salad[y + i][x] != EMPTY_CHAR) if (salad[y + i][x] != EMPTY_CHAR)
@ -116,5 +116,11 @@ 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)
{ {
for( int i = 0; i < searchFieldLen; i++ )
{
for( int j = 0; j < searchFieldLen; j++ )
{
printf("%c", salad[i][j]);
}
}
} }

View File

@ -86,7 +86,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
if (y + wordLength > searchFieldLen) continue; if (y + wordLength > searchFieldLen) continue;
//Prüfen ob kein anderes Wort im Weg //Prüfen ob kein anderes Wort im Weg
int fits = 1; int fits = 1;
for (int i = 0; i < wordLength; i++) for (int i = 0; i < wordLength; i++)
{ {
if (salad[y + i][x] != EMPTY_CHAR) if (salad[y + i][x] != EMPTY_CHAR)
@ -116,5 +116,11 @@ 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)
{ {
for( int i = 0; i < searchFieldLen; i++ )
{
for( int j = 0; j < searchFieldLen; j++ )
{
printf("%c", salad[i][j]);
}
}
} }

View File

@ -86,7 +86,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
if (y + wordLength > searchFieldLen) continue; if (y + wordLength > searchFieldLen) continue;
//Prüfen ob kein anderes Wort im Weg //Prüfen ob kein anderes Wort im Weg
int fits = 1; int fits = 1;
for (int i = 0; i < wordLength; i++) for (int i = 0; i < wordLength; i++)
{ {
if (salad[y + i][x] != EMPTY_CHAR) if (salad[y + i][x] != EMPTY_CHAR)
@ -116,5 +116,11 @@ 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)
{ {
for( int i = 0; i < searchFieldLen; i++ )
{
for( int j = 0; j < searchFieldLen; j++ )
{
printf("%c", salad[i][j]);
}
}
} }