Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dice-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dice-js

Roll some dice.

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

h2. Work In Progress

This is currently a work in progress. The notes below are mostly for myself, and are what I am aiming for the library to do.

Mostly, this is a test repository for my other two repositories: "node-infuse":http://github.com/jhamlet/node-infuse and "sake-node":http://github.com/jhamlet/sake-node.

Eventually this will work; as a nodejs module or a browser loaded file...

h2. Expressions

{background:#ccc}. |. Expression |. Function |_. Explanation | | XdY | Standard | Roll X dice with Y faces and sum the results. | {background:#ccc}. | XdYlN | Low | Roll X dice with Y faces, keep N lowest | | XdYhN | High | Roll X dice with Y faces, keep N highest | {background:#ccc}. | XdYdN | Drop | Roll X dice with Y faces, drop N lowest, and sum the results. | | XdYkN | Keep | Roll X dice with Y faces, keep N highest, and sum the results. | {background:#ccc}. | XdYrN | Reroll | Roll X dice with Y faces, re-roll any dice lower than N, and sum the results | | XdYe | Explode | Roll X dice with Y faces, roll an additional dice with Y faces for each result that rolls Y. Sum the results. | {background:#ccc}. | XdYsN | Success | Roll X dice with Y faces, and count any results equal to or greater than N as a success. | | XdYo | Open | Rol X dice with Y faces, explode any dice that roll Y. Return highest result. | {background:#ccc}. | XdYgN | Glitch | Roll X dice with Y faces. Count the number of dice that came up equal to or lower than N. If the count is equal, or lower than, X display Glitch. If the count is more than half of X display Critical Glitch. |

Note: the expression letters are case in-sensitive. i.e: 3d6 is the same as 3D6, as is 5d6d2 equivalent to 5d6D2, etc...

You can combine the expressions to get different behaviors:

{background:#ccc}. |. Expression |. Function |_. Explanation | | XdYesN | Exploding Success | Combines Explode and Success. Additional dice from exploding can generate additional successes. |

h3. Examples

{background:#ccc}. |. Expression |. Result | | 3d6 | [4, 5, 3] = 12 | {background:#ccc}. | 5d6l2 | [4, 5, 3, 2, 1] = 2, 1 | | 5d6h2 | [3, 2, 4, 4, 1] = 3, 4 | {background:#ccc}. | 5d6d2 | [4, 5, 2, 3, 1] = 12 | | 5d6k3 | [1, 3, 4, 5, 5] = 14 | {background:#ccc}. | 3d10r1 | [7, 8, 4] = 19 | | 5d6e | [1, 3, 6, 2, 4, 3] = 19 | {background:#ccc}. | 5d6s5 | [1, 4, 5, 6, 3] = 2 | | 6d6es5 | [2, 3, 5, 6, 6, 4, 3, 5] = 4 | {background:#ccc}. | 3d10o | [7, 10, 6] = 10 | | [1d12 2d8 3d6]k2 | [7, 3, 1, 3, 5, 1] = 12 | {background:#ccc}. | [3d6 2d8]h2 | [3, 1, 5, 5, 7] = 5, 7 |

Keywords

FAQs

Package last updated on 25 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc