descriptionA set of classes for parsing, evaluating, and formatting die roll strings.
ownersaid@saidachmiz.net
last changeSun, 5 Dec 2021 00:22:07 +0000 (4 19:22 -0500)
content tags
add:
README.md

SA_Dice

A set of classes for parsing, evaluating, and formatting die roll strings.

A “die roll string” is a string that contains an expression that defines operations that (usually) involve the rolling of dice, and possibly various operations on the results of those die rolls. (See “What Are Dice?” and “What’s This For?”, below, for more info. See the header files for each of the classes for more detailed documentation.)

Examples

What Are Dice?

In real life, a die (https://en.wikipedia.org/wiki/Dice) is a small object, usually shaped as a regular polyhedron, on each face of which is inscribed some sort of symbol. When tossed on a flat surface, a die lands in such a way as to have one face facing up, and therefore showing one of the symbols. Dice are used in gambling, tabletop gaming, etc.

The “digital” implementation of a die is a random number generator, configured (usually) to generate integers in a contiguous interval [1, n] (where n is the number of faces the die has), with a uniform distribution over the entire interval. (I say “usually” because some unusual sorts of dice exist, such as Fudge dice (https://en.wikipedia.org/wiki/Fudge_(role-playing_game_system)#Fudge_dice), but those are basically variations on the same theme.)

What’s This For?

The most common use is “dice bots” and “dice rollers”, programs designed to simulate the rolling of physical dice. Such programs are often used when playing certain sorts of games, such as tabletop roleplaying games (https://en.wikipedia.org/wiki/Tabletop_role-playing_game) on the internet. Other uses exist as well.

SA_Dice is copyright (c) 2019 Said Achmiz. It is licensed under the MIT license. See the file “LICENSE” for more information.

shortlog
2021-12-05 achmizsUpdated LICENSE and info commentsmaster
2021-12-05 achmizsSlight refactor, plus cleanup
2021-12-05 achmizsCode/comment cleanup
2021-12-05 achmizsCode/comment cleanup
2021-12-05 achmizsUnlink random sources for different die sizes
2019-07-25 achmizsRemoved more extraneous files
2019-07-25 achmizsRemoved extraneous files
2019-07-25 achmizsMany updates
2016-05-10 Said AchmizAdd minus sign rectification in output
2016-05-10 Said AchmizCreate some dice comparator functions (in SA_DiceCompar...
2016-04-05 Said AchmizAdd method to SA_DiceParser to join two already-parsed...
2016-04-05 Said AchmizChange order of checking for operators; this should...
2016-04-05 Said AchmizFix bug with leading negation operator in roll commands
2016-04-04 Said AchmizFixed bug in 'roll multiple dice' of SA_DiceBag
2016-04-04 achmizsCreate .gitignore
2016-01-17 achmizsRemove extraneous logging.
...
heads
2 years ago master