A recently made over-eager optimization made some expressions
like d6-d6
generate wrong probability distributions. It
is fixed now.
The probability calculator now allows text operations when calculating probabilities. Beware that this will list all possible strings that can be generated, so don't use it for, for example, the d20 character definition, as that can generate 176=24137569 different strings.
It is, however useful if you want to return two independent values
(such as width and height of a roll), as you can return the pair of x
and y
by writing.
"(" || 'x || "," || 'y || ")"
minimal
and maximal
.I have added two new operators: minimal
and maximal
. They are similar to min
and max
, but where min
returns a single copy
of the minimal value, minimal
returns all minimal values.
For example, min{2,2,3}
returns 2
but minimal{2,2,3}
returns 2 2
.
Similarly, maximal
returns all maximal values. Note
that minimal
and maximal
,
unlike min
and max
, are defined on empty
collections, where they return the empty collection.
In hope that the spamming was done by a script rather than a human being, I have added a rather simple-minded fix: If you wish to save a definition, the description must start with a backslash and a space, e.g., "\ my roll". This should foil most scripts but allow humans to use the option. If the spam reappears, I will add stronger measures.
Some spammers have misused the possibility of saving user-defined definitions to post spam. Hence, I have disabled this option until I find a solution, which might be a login procedure or moderation. I will post here when this happens.
foreach
fixed.An earlier attempt at optimisation introduced some bugs. I thought
I had fixed them, but one remained for foreach
which
means that use of an assigned variable inside foreach
sometimes gave wrong probabilities. This is fixed now.
If you have made any probability calculations
using foreach
in the last couple of months, you should
probably redo them to be sure you get the right result.
As you will have noticed, this page of news and comments have been added to the Troll dice roller page. I will use the news page to announce new developments and features to Troll. New entries will be added at the top of the page.
I will start by mentioning a few changes that I have (silently) made over the last few months.
As some of you may have noticed, the Troll the dice! button has been replaced by two separate buttons for rolling dice and calculating probabilities. Additionally, you can now specify how many digits of precision you want shown for the probabilities and you can choose if the second column shows the probability of the result being ≥, ≤, > or < than the value shown. The first column and the graph will always show the probability of the result being equal to the shown value.
Another change involves the Troll language itself.
?
p, where p is a probability written as a
0 followed by a decimal point and at least one digit (e.g.,
0.141592) will return 1 with probability p and the empty
collection with probability 1-p. It is usually combined
with if-then-else
, such as
in if ?0.312 then 7 else 9
,
which will choose 7 with probability 0.312 and 9 otherwise.
The ?
operation allows choice with arbitrary
probabilities, where the previous operations (such
as choose
only allows choice with uniform probability.