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

ssoloff / dice-server-js / 143 / 1
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 13 Oct 2015 05:19PM UTC
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

13 Oct 2015 05:08PM UTC coverage: 100.0%. Remained the same
143.1

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

Source Files on job 143.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 4
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 143
  • Travis Job 143.1
  • 4d49ff1e on github
  • Prev Job for on master (#142.1)
  • Next Job for on master (#144.1)
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