Giter VIP home page Giter VIP logo

rpgroller's Introduction

Rolls dice using the format you may see in a tabletop RPG, e.g. '3d6'.

roll() does a single roll. When called using argv, one roll will be performed and output will be to STDOUT as a string.

Roll Description String Format:

  • 1d6 Rolls a dice with 6 sides
  • d6 Same
  • 12d4 Sum of twelve d4 results
  • 4d6kh3 Rolls 4d6 and returns the sum of the highest three dice
  • 4d6kl3 ...lowest
  • 2d6+2 Sum of 2d6 and 2
  • 2d6-1 Sum of 2d6 and -1
  • 3d8*10 Product of 3d8 and 10
  • 3d6rr2 Rolls 3d6 but rerolls any 2's or below
  • 3d6rr2o Rerolls only once per die
  • 6d10>7 Counts the number of rolls that meet or exceed 7
  • d6+1<3 Counts the number of rolls (adding 1 to each die) that exceed 6
  • 6d10>7s Counts rolling a 10 (the maximum roll) as two successes instead of 1 ("Specialization" from V20)
  • 6d10>7b Rolling a 1 now counts as -1 success
  • 6d10>7sb Works
  • 6d10>7sbc Cancels the effects of a max roll (necessarily only important in rolls with 's')
  • 6d10>7=4 Returns 1 if 4 or more successes are achieved, 0 if not.
  • 6d10>7sb=4 Same but returns -1 if the number of successes is negative (a botch in V20)

This does not count a success by the best roll necessarily. 's' rolls only work for '>' rolls. Roll descriptions are not case sensitive. If min1 is true and the roll is a difficulty check the script will intentionally crash.

rpgroller's People

Contributors

interestsfantastic avatar

Stargazers

 avatar  avatar

Watchers

 avatar

rpgroller's Issues

'3d6hk2*200'

print(roll('3d6hk2*200')) printed 2800... so, 14 on 2d6... not good.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.