1.1.0 • Published 7 years ago

spb14-device v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Device

Random device

Example

const Device = require('spb14-device');

class RandomNatural extends Device {
    next (n) {
        let i = Math.floor(this.urv * n);

        return super.next(i);
    }

    init (n) {
        return super.init(n);
    }
}


let die = new RandomNatural(10);

die.get().then(console.log); // '6'

Install

npm install spb14-device

API

Prototype properties

  • .urv Uniform random variate

Prototype methods

  • .get()

  • .next(index)

  • .init(...argv)

License

MIT License

1.1.0

7 years ago

1.0.0

7 years ago