flak-cannon-picker

0.1.1 • Public • Published

Flak Cannon Picker

Main project: flak-cannon

uniformChoice(seed:Any, choices:Array)

Returns a choice from the array, based on a seed
Note: seed will be converted to a string via String(seed)

picker = require 'flak-cannon-picker'
picker.uniformChoice('mySeed'['item1''item2''item3'])

weightedChoice(seed:Any, choices:Object:)

Returns a choice from the array, based on a seed and weights
Note: seed will be converted to a string via String(seed)

picker = require 'flak-cannon-picker'
picker.weightedChoice('mySeed'{item1: 1item2: 1item3: 8})

Readme

Keywords

none

Package Sidebar

Install

npm i flak-cannon-picker

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • zolmeister