flak-cannon-picker
Main project: [flak-cannon](https://github.com/claydotio/flak-cannon)
Last updated 5 years ago by zolmeister .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install flak-cannon-picker 
SYNC missed versions from official npm registry.

Flak Cannon Picker

Main project: flak-cannon

uniformChoice(seed:Any, choices:Array<Any>)

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<String>:<Number>)

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})

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

4 Versions

  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |