0.1.1 • Published 9 years ago

flak-cannon-picker v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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: 1, item2: 1, item3: 8})
0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago