• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ssoloff / dice-server-js / 143
100%

Build:
DEFAULT BRANCH: master
Ran 13 Oct 2015 05:19PM UTC
Jobs 1
Files 33
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
143

push

travis-ci

ssoloff
Use `random-js` module for random number generation.

We are primarily using this module for two reasons:

1) We want to be able to use an RNG that supports seeding.  A future change is going to include an RNG seed in a ticket to ensure redeeming a ticket always generates the same expression result no matter how many times it is redeemed (and relieves the service from having to persist the ticket IDs it has already redeemed).

2) We want to avoid bias in die rolls as much as possible.  Our previous algorithm was subject to bias as described at <https://github.com/ckknight/random-js>.

Using this module required a significant change in how we modeled RNGs.  Previously, an RNG was a zero-argument function that returned a value in range [0,1).  Now, an RNG is a one-argument function that returns a value in the range [1,`sides`], where `sides` is the single RNG argument.  This is due to how `random-js` generates a random number from both an engine and a distribution.  We cannot simply stub the engine to generate a specific random number using the `integer` distribution because the distribution algorithm does not use a simple mapping function to go from the engine value to a value in the range [1,`sides`].  Therefore, the entire engine/distribution combination must be abstracted behind the "RandomNumberGenerator" interface.

1788 of 1788 relevant lines covered (100.0%)

5.54 hits per line

Jobs
ID Job ID Ran Files Coverage
1 143.1 13 Oct 2015 05:19PM UTC 0
100.0
Travis Job 143.1
Source Files on build 143
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #143
  • 4d49ff1e on github
  • Prev Build on master (#142)
  • Next Build on master (#144)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc