Assuming you have
crystal installed, simply "git clone" it:
git clone https://github.com/delkano/diceroller.git
Then enter the directory and
You'll find two executables under the
rollHedron. First one uses
libui.cr directly, second one uses
Usage is simple. You just invoke it with
which will load the interface. You can write the roll descriptor on the text field and press the
Roll! button to get the results.
Roll descriptors are of the form:
expression [expression]* with expression := dice[<+|->dice]* dice := <number>[<a|d><number>]
1d6 : Roll 1 die of 6 sides 4d4+3 : Roll 4 dice of 4 sides each, sum the results, and add 3 to that 1a8 3d10: Roll 1 die of 8 sides, with explosions, then 3 dice of 10 sides, add these results, and show both rolls individually
explosions mean that, if the result is the maximum value for the die, it gets rolled again and the totals are added. Ex., a 6 on a 6-sided die means a new roll, which yields let's say a 3, result is 6+3=9.
The Dice Roller uses a config file, called
config.ini, and stored in the
This file must contain a
[general] section, with one only entry,
model, describing the preselected button set.
Then, it must contain at least the preselected button set, plus as many others as the user wants, in the format:
[<name>] label=roll descriptor label 2=roll descriptor 2
This sets describe predefined roll buttons, which are shown on the UI for common rolls.
If this file becomes corrupted, simply erasing it will cause the program to create a new one, with only the "basic" button set.
- Fork it (https://github.com/your-github-user/roll/fork)
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
- Diego Cano - creator and maintainer