package odds

  1. Overview
  2. Docs
Dice roller

Install

Dune Dependency

Authors

Maintainers

Sources

1.2.tar.gz
md5=17fb0a345940e7386c6fa3be25257cf3
sha256=1ff1811686f83a278739761bc016ff2ef255385226a77ca00eb9276831755950
sha512=05317be9d6ecc613afb9ec6c702da2869f8e73b24bf2568087f3ae8c02454b14a105b4e10248d48803631abf8ddf60f2931931e704adf5f7631e41184848474b

Description

Tags

games dice random

Published: 05 Oct 2022

README

Odds — OCaml Dice Dice Something

%%VERSION%%

Odds is an OCaml library for rolling dice. It features deterministic dice rolls and it uses effects in order to leave all PRNG choices to the binary/main rather than embedding it in the library code.

Installation

Odds can be installed with opam:

opam install odds

Structure

  • Odds.Dice contains basic definitions for dice rolling. The code exported by this module only ever perform the Odds.Dice.Roll effect and no other side-effect. In particular it does not handle PNRG state: instead, the caller of eval is responsible for installing an effect handler for Roll.

  • roll is an implementation of a simple dice-roller using the Odds library. It is mostly intended to be used as an example for how to use Odds. In particular, how to handle the Roll` effect.

  • tests/ contains tests for the parser (Odds.Parser, Odds.Lexer) and the roller (Odds.Dice.eval function). This latter test only checks that the evaluation of a formula performs the expected Roll effects, it does not make any assertion on the actual result.

Documentation

To generate the documentation, use dune build @doc

To consult online documentation, visit https://raphael-proust.github.io/code/odds/index.html

Dependencies (4)

  1. cmdliner >= "1.1.1"
  2. menhir build
  3. ocaml >= "5.0.0"
  4. dune >= "3.0.0"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.