Commit 2206728f authored by Ivaylo Ivanov's avatar Ivaylo Ivanov

Add a larger randomizer base

parent 041fac99
......@@ -34,6 +34,7 @@
void swap(int *a, int *b);
void shuffle(int arr[], size_t size);
static unsigned int base_seed = 0;
int main(int argc, char *argv[]) {
if(argc < 2) {
......@@ -189,8 +190,8 @@ void swap(int *a, int *b) {
* @return res
**/
void shuffle(int arr[], size_t size) {
srand(time(NULL)); ///< Set a random seed
base_seed = (base_seed + 1) % (__UINT64_MAX__); ///< Extreme values for the randomizer
srand(base_seed); ///< Set a random seed
int j = 0; ///< Index that will be randomized later on
for(int i = size - 1; i > 0; i--) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment