Srand() nur einmal in createWordSalad
This commit is contained in:
parent
190b40468f
commit
cb02cbb972
@ -14,6 +14,7 @@
|
||||
// Creates the word salad by placing words randomly and filling empty spaces
|
||||
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));
|
||||
Position position[(2 * MAX_SEARCH_FIELD_LEN * (MAX_SEARCH_FIELD_LEN - MIN_WORD_LEN + 1))]; //Positionsarray Größe: Formel max. nötige Größe (für minimal großes wort)
|
||||
int gesetzteWörter = 0;
|
||||
clearWordSalad(salad, searchFieldLen);
|
||||
@ -50,7 +51,6 @@ void clearWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi
|
||||
//Funktion für den Schluss: Übrige leere stellen werden random befüllt.
|
||||
void fillWordsaladRand(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen)
|
||||
{
|
||||
srand(time(NULL));
|
||||
for(int i = 0; i < searchFieldLen; i++)
|
||||
{
|
||||
for(int k = 0; k < searchFieldLen; k++)
|
||||
@ -133,7 +133,6 @@ int findPossiblePositions(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN]
|
||||
//den ganzen möglichen fällen und dann das wort ins grid gezeichnet werden.
|
||||
int fuelleSalatMitWörtern(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsigned int searchFieldLen, const char words[][MAX_WORD_LEN], Position position[], unsigned int wordcount)
|
||||
{
|
||||
srand(time(NULL));
|
||||
int gesetzteWörter = 0;
|
||||
int positionsamount;
|
||||
int positiongewählt;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user