Merge branch 'simons_weg' of https://git.efi.th-nuernberg.de/gitea/hallerni98888/info2Praktikum-DobleSpiel into simons_weg
This commit is contained in:
commit
6b3294d40b
@ -24,6 +24,7 @@ unsigned int checkArray(unsigned int *array, unsigned int len, unsigned int numb
|
||||
{
|
||||
free = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +35,7 @@ unsigned int *createNumbers(unsigned int len)
|
||||
{
|
||||
srand(time(NULL));
|
||||
unsigned int *array = (unsigned int *)malloc(len * sizeof(unsigned int));
|
||||
int randomNr, randomPos, counter, filler;
|
||||
int randomNr, randomPos, filler;
|
||||
|
||||
|
||||
if (array == NULL)
|
||||
@ -51,7 +52,7 @@ unsigned int *createNumbers(unsigned int len)
|
||||
{
|
||||
do
|
||||
{
|
||||
array[i] = rand() % (2 * len) + 1;
|
||||
array[i] = (rand() % (2 * len))+ 1;
|
||||
} while (!checkArray(array, i, array[i]));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user