dice rolling library
Go to file
2018-02-17 11:27:15 +01:00
lib add copyright headers 2018-02-17 11:27:15 +01:00
tests add copyright headers 2018-02-17 11:27:15 +01: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 add tiny expression library and make it a dice expression parser 2018-02-17 10:52:46 +01:00
COPYING.LESSER follow GNU standards on licencing 2018-02-17 11:20:46 +01:00
LICENSE.tinyexpr follow GNU standards on licencing 2018-02-17 11:20:46 +01:00
Makefile.am add tiny expression library and make it a dice expression parser 2018-02-17 10:52:46 +01:00
NEWS first version of libdice 2018-02-13 19:27:38 +00:00
README update readme 2018-02-17 11:07:53 +01:00
TODO.org add todo list 2018-02-17 11:06:35 +01:00

** The first version (0.1) is not yet released. API subject to change! **

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>