ActiveX Bar O' Dice


Created with the Visual Basic 5.0 Control Creation Edition


What is Bar O' Dice?

Bar O' Dice is a program for rolling dice. It include a 20-sided die, a 12-sided die, two 10-sided dice (which can be rolled as a percentile die), an 8-sided die, a 4-sided die, and a standard 6-sided die. You can have Bar O' Dice count the number of times each die has been rolled and you can choose whether or not Bar O' Dice keeps a cumulative total of your rolls. A complete history of your rolls is available via a roll log -- you can even cut and paste text from the roll log into other applications.

Bar O' Dice's neatest feature is the Die Expression Calculator. You can use it to "roll" any random number or any combination of dice. You can even use it as a normal calculator.

How Do I Use It?

To roll any of the polyhedral dice, just click on the die itself. The die "rolls" while the mouse button is held down and the roll is complete when the mouse button is released. To roll the two 10-sided dice as a percentile die, click on the '%' sign located under the dice.

To roll a Die Expression, select the expression you want by clicking on the down arrow to the right of the Die Expression Calculator box and selecting from one of the provided expressions. If you want to enter your own expression, click inside the Die Expression Calculator box and type it in (see below). Click on the "Roll" button to evaluate the expression. Expressions that you enter will be added to the dropdown list.

If you want to keep track of how many times you have rolled each die, click on the "Show Roll Counts" box. Small numbers will appear below each die and will be incremented each time a die is rolled.

If you want Bar O' Dice to add up the die values as you roll them, click on the "Keep Cumulative Totals" box. You can zero out the total (and reset the roll counts) by either clicking on the Total box or by clicking the Reset button. Note that Die Expressions from the Die Expression Calculator are also added to the Totals.

What Kind Of Die Expressions Can I Enter?

You can enter any mathmatical expression that uses addition (+), subtraction (-), multiplication (*), and division (/). Expressions can include negative numbers, parenthesis, and decimal fractions.

Expressions can, of course, also contain "Dice". The syntax for using dice in expressions is the same as is used in most role-playing manuals: d12 means a 12-sided die, 2d6 means two 6-side dice, 3d10-5 means add the rolls of three 10-sided dice, then subtract 5. The die can have any number of "sides". If you want to generate a random number between 1 and 27, you can say d27.

Expressions are evaluated left to right in standard arithmetic precedence:

  1. Dice expressions
  2. Parenthetical expressions, inner first
  3. Multiplication and/or division
  4. Addition and/or subtraction

For example, 2+3*5 evaluates to 17, but (2+3)*5 evaluates to 25.

If an expression does not contain any "Dice", then it will be evaluated but will not be added to the drop down list of Die Expressions.

Some valid Die Expressions:

What Is The Log?

Sometimes you might need to access a history of your rolls. For example, you are rolling a character, so you want six rolls of 3d6. Or, you need to roll and add up 10d6, but you also need to know how many fives and sixes that you rolled. The solution to this is the Dice Roll Log.

Click on View Log to display the Dice Roll Log. As you roll the dice (or evaluate Die Expressions) on the main Bar O' Dice window, the results of the rolls are stored in the Dice Roll Log. The entries in the log look like this:

	 3	  3	  d6 (1)
	  -----------------------
	  11	  15	  d20 (2)
	  4	  4	  d20 (1)
	  -----------------------
	  13	  13	  2d6+6 (3)
	  14	  14	  2d6+6 (2)
	  12	  12	  2d6+6 (1)
	  -----------------------

The first column is the value of the roll. The second column is the Total as of that roll. Unless "Keep Cumulative Totals" is selected, this value will be the same as the first column. The last column is the type of the roll and the count.

So, looking at the sample above, the first line shows that one six sided die was rolled and that the result was a 3. The next two lines show that a 20-sided die was rolled twice (getting a 4 and an 11) and the results added up to 15. The last three lines show the Die Expression 2d6+2 rolled three times, without adding up the results. The first roll as a 12, the second a 14, and the third a 13.

Every time you click "Reset" or click on the Total box to reset the Total or click on "Keep Cumulative Totals", a new divider line is added to the Dice Roll Log.

You can cut text from the Dice Roll Log and paste it into other applications. Just highlight the text in the Dice Roll Log with the mouse (click and hold the left mouse button while dragging), then press Ctrl-C to copy the text to the Clipboard. Then go to the other application and Paste the text.

If you want to clear the Dice Roll Log, just press the "Clear Log" button. You can hide the roll log by clicking "Hide" on the Dice Roll Log window. Because the ActiveX Bar O' Dice is an ActiveX control. the Dice Roll Log window is modal, which means it must be dismissed before you can roll dice or access the browser.

Support and Feedback

The Bar O' Dice control is freely distributable, and therefore has no warranties or guarantees. You may copy the object reference and the reference to the CAB file (http://fly.hiwaay.net/~palmer/BarODice.CAB) or the CAB file itself and use it on your own pages. I am open to suggestions on ways to improve the program and I would love to hear from people who are using it. So, if you want to contact me, you can e-mail me at:

Palmer@HiWAAY.net

You may also leave comments on my guest book.

The latest incarnations of this program (and others) can be found on my Web page at:

http://fly.hiwaay.net/~palmer

Thanks for reading this far and happy dicing!

Back to my home page...


Christopher M. Palmer

3/26/97