Home

Awesome

NOW DEPRECATED!

Dicer is still available on hex.pm, but will not be worked on anymore. Check out my new replacement project at gitlab.com named Rollex.

Dicer

A dice roller expression evaluator written in Elixir!

Installation

Pre-requisites

Creating a command line binary

mix escript.build

From here, execute rolls like this:

$ dicer "1+2+3"

Running in interactive shell

iex -S mix

From here, execute rolls like this:

iex(1)> Dicer.roll "1+2+3"

Adding as a mix dependency

In your mix.exs file:

  def application do
    [mod: {MyApp, []},
     applications: [:dicer]]
  end

and this:

  defp deps do
    [{:dicer, "0.4.0"}]
  end

Details

Dicer is an elixir application that lets you evaluate dice rolls with simple arithmetic operators.

Why?

Because it was a fun, somewhat non-trivial way to work in Elixir.

Thanks

Thanks to Lukasz Wrobel for his short series on parsing. Part 3 was my template for my code, even if it took me way too long to translate the loops into recursive function calls!