Welcome to the third incarnation of Nadaka's DiceBox.
- Aliases and UserNames allow better ways to organize the rolls stored in the
- New Security system keeps things simple for you, but should significantly
reduce the impact of spammers.
- Web Service access allows you to incorporate the dicebox in your own
- New dice expression compiler allows increased flexibility and functionality of
- To keep the server running and reduce network traffic, I have limited the number of results in a list to 1000.
- Please keep individual rolls between -(2^31) and (2^31)-1.
- Dice rolls are stored in a centralized database where they can be retrieved at
any time over the web by you or anyone else. This makes it ideal for online games.
- This service is provided free of charge.
- Group membership...
- Better/More themes...
- Directions for more features...
This site uses asp.net web services to allow other site owners to subscribe to this service and use it in thier own web sites.
This web service delivers its results via either xml or json objects. If you wish to use this webservice in conjunction with
comments and group membership, you must register
to recieve a personal access code. This code and the account associated with it
can be banned for inapropriate use. Inapropriate use is currently defined as
using this service for spam or illegal activities and uploading or linking to
pornography, executable scripts or programs, browser exploits and malicious web
Dice Expression Grammar:
0 | 1 | 2 |
3 | 4 | 5 |
6 | 7 | 8 |
9 | + | - |
d | ( | ) |
, | * | x
-> Sum List2
-> , Sum List3 |
* Sum List3 | ϵ
-> , Sum List2 | ϵ
-> Dice Sum2
-> + Dice |
- Dice | ϵ
-> Number Dice2
-> d Number Dice2 |
x Number Dice2 |
-> Digit MoreDigits | (
-> Digit MoreDigits | ϵ
-> 0 | 1 |
2 | 3 |
4 | 5 |
6 | 7 |
8 | 9
DiceBoxWS uses a predictive recursive descent parser with left to right greedy evaluation. Its
tokenizer is a simple lexical analyser that generates tokens from the input stream while ignoring
whitespace. These tokens are fed through the parser, evaluated for gramatic correctness and built
into a parse tree. If the parser has completed without error, the parse tree then processes the
instructions for each token node and accumulates the results.
The original productions listed below suffered from left recursion and ambiguity. After optimization both issues are
resolved as well as the opportunity to take advantage of tail recursion to
List , Sum |
Sum * Sum |
Sum , List
Sum + Dice |
Sum - Dice |
Dice d Value |
Dice x Value |
: generate a random number between 1 and the right
arguement a number of times equal to the left arguement and return a value equal to the
sum. This is analogous to rolling a number of same sided dice and returning the sum.
: as d, except that if an individual random number is equal
to the right arguement, add it and generate again. This is analogous to "exploding" dice.
: as math.
: repeats the right expression a number of times equal to the
left expression and returns a list of the values. This is a shorthand method of generating
large lists of values.
: list seperator.
: override order of operations.
Currently this can not contain the list symbols: '*'