Merge branch 'main' of https://git.efi.th-nuernberg.de/gitea/gloecknerni100842/I2_Projects
This commit is contained in:
commit
41792a6c82
@ -30,6 +30,7 @@ void fillRestWithRandom(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
|
|||||||
// - wordCount -> anzahl an Wörtern
|
// - wordCount -> anzahl an Wörtern
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
srand(time(NULL));
|
||||||
int placedWords = 0;
|
int placedWords = 0;
|
||||||
|
|
||||||
//Feld komplettmit EMPTY_CHAR füllen
|
//Feld komplettmit EMPTY_CHAR füllen
|
||||||
@ -85,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)
|
||||||
|
|||||||
@ -30,6 +30,7 @@ void fillRestWithRandom(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
|
|||||||
// - wordCount -> anzahl an Wörtern
|
// - wordCount -> anzahl an Wörtern
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
srand(time(NULL));
|
||||||
int placedWords = 0;
|
int placedWords = 0;
|
||||||
|
|
||||||
//Feld komplettmit EMPTY_CHAR füllen
|
//Feld komplettmit EMPTY_CHAR füllen
|
||||||
@ -85,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)
|
||||||
|
|||||||
@ -30,6 +30,7 @@ void fillRestWithRandom(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN],
|
|||||||
// - wordCount -> anzahl an Wörtern
|
// - wordCount -> anzahl an Wörtern
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
srand(time(NULL));
|
||||||
int placedWords = 0;
|
int placedWords = 0;
|
||||||
|
|
||||||
//Feld komplettmit EMPTY_CHAR füllen
|
//Feld komplettmit EMPTY_CHAR füllen
|
||||||
@ -85,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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user