This  is a  small set  of  programs and  libraries to  roll dices  and
compute statistics.

Requirements:
-------------
 * An C compiler (gcc 3.x or 2.95 works fine)
 * A working random()/rand() function in the C library
 * A "make" program
 * A working autoconf/automake installation

This program was  tested on Debian GNU/Linux, using  GNU Make, GCC and
on FreeBSD  4.10, using default make  and GCC.  It should  work on any
POSIX system,  and even  in non-POSIX ones  like Windows.  If  you can
compile and use it in another environement, please tell me.

What is this ?
--------------

dice2 is a library and a set of tools to roll dices and get statistics
about dices. It is available under the terms of the GNU GPL.

A "dice code" is a mathemical expression, with some dice rolls result.
Like "4d6+3" is  a "dice code", it means to roll  4 6-sided dices, sum
them up, and add 3.

The library  can parse a dice  code into a syntax  tree, allowing fast
evaluation of the tree afterwards.  The result will, of course, change
with  each  subsequent  evaluation  of  the tree,  as  the  dices  are
rerolled.  The "mean" program calls  the evaluator plenty of times, to
compute empirical  statistics about the "dice code",  and display them
to users.

In addition to basic evaluation of  "dice codes" and trees as a whole,
the library  can report all single  die rolled, or all  group of dices
rolled, to give more feedback to the user.

Starting with  version 0.5.0,  the syntax tree  can also  be evaluated
with fuzzy  logic, returning the probability of  each possible result.
This can be  used by "mean" to give a mathemically  exact answer, in a
short time (for simple dice codes), or may be used as you wish in your
own program.  Pay  attention that a very complex  "dice code" can take
ages to evaluate with the fuzzy logic code, and eat a lot of memory. A
"dice  code" that  has an  infinite range  of possibilities  (like the
Rolemaster dice) cannot get evaluated with fuzzy logic.

Python binding:
---------------

Since 0.5.8, the Python bindings  are supplied in a different package,
pydice, available at the same location.

Extra applications - not done yet, may come later:
--------------------------------------------------

Some of the applications included may need some extra features:
 * The dicefs translator works only on GNU/Hurd and requires a GNU99 C
   compliant compiler (gcc 3.x).
 * The php interface needs a PHP3 or PHP4 interpreter.
 * The Gtk+ interface needs Gtk+ 2.0

Feel free to suggest some  other applications and features, or better,
to code them and submit them !

Testing:
--------

A french-only  PHP interface to most  of the features  is availbale at
http://drizzt.kilobug.org/php/jdr/dice.php (during daytimes).

A PHP interface may be included one day too.

Compiling and Installing:
-------------------------

Use the standard autoconf procedure (./configure; make; make install)
See INSTALL for more informations.

Todo:
-----

* Update the Python bindings
* Use GNU gettext for translations
* Write more programs (like gtk front-end, translator and PHP front-end)
* Optimize the fuzzy logic code
* Add more dice codes (if you have any suggestion, mail me)

Contact:
--------

For  more informations: mail  me at  <kilobug@hurdfr.org> or  look for
'kilobug' on Open Projects Network (irc://irc.openprojects.net)

