Saturday, June 19, 2010

Let's Roll Some Dice

I reimplemented my very simple dice rolling module. It is now a pair of functions instead of a struct, and it supports strings as input.

Couple examples:
auto roll = rollDice("1d4"); // results in a value between 1 and 4
auto roll2 = rollDice("2d6+2", 4); // results in a value between 8 and 18
auto roll3 = rollDice(1, 8, -2); // results in a value between -1 and 6
The parser doesn't support strings like "1d4 + 2d6". I have no plans to add that kind of support any way as it can be combined from smaller pieces.

Source code: here

Sunday, April 4, 2010

Undeath

This blog's been dead for about two years now, and I don't see much of chance that it will change in the near future.

I've started sharing some stuff in Google Reader from all the blogs I'm following, here:
http:

There's mostly AS3/Flash stuff, as that is the focus of my interests at the moment. If I have time I might write something about the PushButton Engine.