Information
Welcome to the third incarnation of Nadaka's DiceBox.
New Features:
- Aliases and UserNames allow better ways to organize the rolls stored in the
system.
- 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
websites/applications.
- New dice expression compiler allows increased flexibility and functionality of
dice rolling.
- 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.
Legacy Features:
- 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.
Comming soon:
- Group membership...
- Statistics...
- Better/More themes...
- more...
- Directions for more features...
Technology
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
sites.
Dice Expression Grammar:
-
Tokens:
0 | 1 | 2 |
3 | 4 | 5 |
6 | 7 | 8 |
9 | + | - |
d | ( | ) |
, | * | x
-
List
-> Sum List2
-
List2
-> , Sum List3 |
* Sum List3 | ϵ
-
List3
-> , Sum List2 | ϵ
-
Sum
-> Dice Sum2
-
Sum2
-> + Dice |
- Dice | ϵ
-
Dice
-> Number Dice2
-
Dice2
-> d Number Dice2 |
x Number Dice2 |
ϵ
-
Number
-> Digit MoreDigits | (
Sum )
-
MoreDigits
-> Digit MoreDigits | ϵ
-
Digit
-> 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
looping optimization.
-
List
->
List , Sum |
Sum * Sum |
Sum , List
-
Sum
->
Sum + Dice |
Sum - Dice |
Dice
-
Dice
->
Dice d Value |
Dice x Value |
Value
Symbol Meanings:
'd': 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.
'x': 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:
'*' and
','.