@brightsole/bg-utils
v1.0.3
Published
various utils for use in board game evaluation
Downloads
4
Maintainers
Readme
bg-utils
What are they?
| Method | Props | Description | | :---------------: | :--------------- | :--------------- | | shuffle | ([any]) | Randomly shuffles an array of inputs of any type, very random | | selectUniqueRandoms | | Non-repeatingly selects any number of elements, randomly from an array | | | arrayToSelectFrom | the array of items to randomly pick from | | | numberToSelect | the number of random selections to make | | selectUniqueIndices | | Non-repeatingly selects a number of numbers from 0 to max index | | | numberToSelect | the number of indices to return in an array | | | max | the highest number that can be returned |
How to use them?
import it, and start using the functions within!
import { selectUniqueRandoms } from '@brightsole/bg-utils';
const aFewRandoms = selectUniqueRandoms({ max: 3, numberToSelect: 2 });
console.log(aFewRandoms);
TODO:
nothing! No plan here, just a bucket to collect random useful methods for consumption elsewhere