Skip to content

brightsole/bg-utils

Repository files navigation

bg-utils

What are they?

tl;dr: an ever expanding set of utils that are useful in many areas of board game development
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?

tl;dr: `npm i @brightsole/bg-utils`

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


Buy Me A Coffee