dice rolling library
Go to file
2018-02-14 18:31:52 +00:00
lib make the parser reentrant 2018-02-14 18:31:52 +00:00
tests first version of libdice 2018-02-13 19:27:38 +00:00
AUTHORS first version of libdice 2018-02-13 19:27:38 +00:00
ChangeLog first version of libdice 2018-02-13 19:27:38 +00:00
configure.ac first version of libdice 2018-02-13 19:27:38 +00:00
COPYING first version of libdice 2018-02-13 19:27:38 +00:00
Makefile.am make the parser reentrant 2018-02-14 18:31:52 +00:00
NEWS first version of libdice 2018-02-13 19:27:38 +00:00
README first version of libdice 2018-02-13 19:27:38 +00:00

libdice is a small library used for parsing dice expression and rolling dice.
It is mainly suitable for small projects that wish to support pen and paper
style dice syntax.

Features:

  o Written in clean C
  o Easy API as well as advanced API
  o Solid and reliable RNG
  o Unit tests

Dice syntax support:

  o Variable sides
  o Variable amount

Requirements:

  o arc4random_uniform (or libbsd on non-BSDs)
  o cmocka (for unit tests)
  o bison
  o flex

Compilation

  $ ./configure --prefix=/usr
  $ make
  $ doas make install

Usage:

  The functions ``dice_simple`` and ``dice_parse`` create a new ``dice_t``
  object which can be used in conjunction with ``dice_roll`` and
  ``dice_evaluate`` to generate random numbers. ``dice_free`` must be used
  to cleanup a created ``dice_t`` object.


  dice_t d20 = dice_simple(1, 20);
  int64_t res = dice_roll(d20);
  dice_free(d20);

Authors:

  Florian Stinglmayr <florian@n0la.org>