<<Back to the roller

Enrollo CGI Documentation

Enrollo CGI is the web-based interface for enrollo, a dice roller written in C in the winter of 2010 by José J. Atria. Written as a way to pass some time in the long winter holidays, enrollo is deceptive in its simplicity, and supports a number of quite powerful options, most of which are accesible through this web interface.

Let's get to it.

The textfields

The first textfield is the roll argument text field. This is where you enter your main roll argument. The roll arguments consist of a number of elements that will be covered below.

  • The number of sides
    A positive integer between 1 and 9999 stating how many dice to roll.
  • The type of dice
    A single character stating whether the dice to be rolled is a standard, explosive or zero-biased die.
  • The number of sides
    A positive integer between 1 and 99999999 stating how many sides the die should have. Note that for zero-biased die, this number indicates the number of sides on the die, and not the maximum result for the die.
  • Optionally, you can add a t character followed by an integer to indicate a target number.

    After this (and without any spaces) you can add a second operand (and an operator) to modify the result of the previous roll argument.

    If there is a target number, the result will indicate the amount of dice whose results are higher to or equal than the target selected (needless to say, if the target is larger than the number of sides, it will be ignored).

    Otherwise, the result will indicate the total sum of the results of each rolled dice.

The default value for the main roll argument is "1d6". This will be used if nothing is input, or if what is input gets discarded by the parser.

The second textfield, labeled "Repeat", indicates the amount of times (if any) that any given roll is to be repeated, and should be quite self explanatory. This can be any integer number between 1 and 100000.

The third textfield, labeled "Discard", states what dice (if any) are to be discarded. This number has to be an integer, but the way in which it will be interpreted will difer if it is a positive or a negative number. If this number is set (and it is not zero), it will indicate the amount of dice with the lowest results that should be discarded (if it is positive) or the amount of dice with the lowest results that should be kept (if it is negative). This box works in unison with the checkbox labeled "Re-roll", but more on that later.

The check boxes

Below the textfields there are a series of checkboxes with more options. These are:

  • Persistent results
    Checking this will generate a html labeled secuentially which will remain in the server for a limited amount of time.
  • Show operands
    Useful only in rolls with more than one operand, this will show the results that each individual operand got (indicated by a > character).
  • Show rolls
    Checking this will show the result of each individual die. Depending on what other options where set, this option will indicate all sorts of useful information on the result of each dice, and the way in which it was interpreted (useful mostly to dissipate misgivings on the randomizer).
  • Substract botches
    In rolls that have a target, this option will cause the dice with a result of 1 to be substracted from the total. This can, of course, lead to negative results, which will most likely indicate negative results.
  • Re-roll
    In rolls in which a positive discard number has been stated, the discarded dice will be re-rolled.

Have fun! If you have any questions or comments, write them to
jjatria {at} gmail {dot} com.

enrollo and all associated programs are released under the GNU General Public License, and therefore are (and always will be) Free Software. You have permission to copy, distribute and/or modify this software as stated in the aformentioned license. Be good.

You can find the source code for version 0.5 here, but be advised that it is not yet thoroughly commented and things are far from being as efficient as they could be (after all, I only found out about getopt() after I finished this version). In fact, were it not for the fact that this was the first version to finally work with all the basic features I intended it to have from the start, I would not be putting it up. But I cannot bring myself to make the program available without uploading at least a crappy version of the code. Enjoy it!

You can find the CGI script here, but I don't imagine that will be of any particular interest to many of you. However, take notice that I don't intend to keep track of versions for the script, and it may be changed without notice.

Last update: 08/09/2010

<<Back to the roller