Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pdcawley (485)

pdcawley
  (email not shown publicly)
http://www.bofh.org.uk/
AOL IM: pdcawley (Add Buddy, Send Message)

Journal of pdcawley (485)

Sunday June 03, 2001
05:23 PM

Roll the dice

[ #244 ]
So, you know how it is, several things come together and before you know it you've killed 2 hours of a Saturday morning that could've been spent cuddling your wife hacking up some cool gadget.

How? Why? Well, it's like this:

  1. Sat around on #london.pm one day a while back, somebody told dipsy (the local infobot) to 'roll 1d6', and what do you know, she rolled a 5. "Cute!", I thought.

    "dipsy, roll 2d6." I say.
    "hunh?"
    "dipsy, literal roll 1d6"
    "roll 1d6 is I rolled a 1| I rolled a 2|..."

    How depressingly simpleminded. So I spent happy half hour knocking up a simple infobot extension to handle (simple) dice rolling, and left it at that.

  2. I went to one of London.pm's semi infamous, semi official technical meetings to watch Leon, Simon and Simon try out some of their YAPC/TPC talks before a sympathetic (constructively critical) audience. Unlike the rest of them I had to head off to rescue my wife from her mother rather than heading off to the pub, but the food for thought was still top notch. Leon's Instant Compilers talk was definitely interesting...
  3. I realised that the die roller was all very well, but it'd be cool if you could do stuff like 'roll 1d6 + (1d6)d10' and get a sensible answer. And it'd be even cooler if, instead of just getting a total, you could get something like: (d6==5 + (1d6==4)d10==(2 5 7 8))==29 or some such 'explanatory' output (I'm still not sure of the best way of doing this.
  4. I've not really played with Parse::RecDescent (or any other parser for that matter...

Well, it was inevitable wasn't it? I've got something that works, now I just need to pick a name for it (Acme::Dice is tempting -- after all Acme made some pretty cool gadgets, and the whole thing is pretty useless really...), tidy up the structure of it (right now it's a multi package single file and the 'diagnostic' stuff isn't even beginning to work), and (eventually) make an infobot extension that uses the module so sad people can use dipsy as a Role Playing Game assistant.

And then, why, the world will be the mollusc of my choice. Conference organizers will beg me to come and deliver talks on using an expensive computer to replace a handful of cheap dice (it's the coming thing you know), women will throw themselves at my feet, people I've never met will ask me to autograph their bare breasts (knowing my luck they'll be men), O'Reilly will want to know when I'm writing the book. Bwah ha hah ha hah!