shufflefy
A Node.js package to shuffle an array.
Usage
Install the package using npm:
npm install shufflefy
Require the package:
const shufflefy = ;
Feed it with an array:
const numberArr = 1 2 3 4 5 6 7;console;
Arguments list:
-
input_arr - input array
-
iteration - number of iterations over the output array
-
starting_seed - same starting_seed and iteration combination would always generate the same result
-
randomizer - a function that takes in a seed(optional) and returns a number between 0 (inclusive) and 1 (exclusive)
Test:
npm test
Examples:
node example.js
Benchmarking:
node benchmark.js
License
MIT