Skip to content
27 May 32010 / Robin Wellner

No Dice

Ever felt the need for an application that you could pass a description of some dice to roll, which you then could use in lieu of physical dice in a role-playing game?

Yeah, me neither.

So, to fill the urgent needs of this non-existent market, I set forth to write dice, a dice-rolling application, written purely in Python.

Of course, I wasn’t the first who has written something like that: I discovered the command-line dice roller. It is much large than dice (it has an effective code-base of around 100kB, with a total distribution size of 400kB, while dice totals at just 10.6kB, of which 5.7kB is documentation.) To me, the funny part is that the roller is not much more expressive than dice (although it does have some nifty features).

I wrote dice mainly to work on a proper project for once, so I could write:

  • A man page
  • A complete and powerful command-line interface
  • Fully documented source code (with the help of docstrings)
  • A clean API

So how fast is it? Pretty fast. It can throw 23,000 dice in a row before I notice a delay (and that says a lot, since my computer is if an era long gone).

You can get a source distribution here.

It has no license, but I’m making this available under the terms of the Implicit License (website). That is, until I give it a proper license, you have explicit permission to use, share and improve dice, as long as you use a popular Open Source license if you publish any changes (see the website for details).

Advertisements

2 Comments

Leave a Comment
  1. Luiji Maryo / Jun 13 2010 0:29

    The reason Roll is so large is because it is written in C, so they have to do tons of memory management and stuff, along with the fact that C does not have nearly as many useful libraries as Python.

    This is a fun program, and it is well written. You should try packaging it and getting it up on the Linux software repositories. A could way to do this is by registering your project at theopenSUSE Build Service, which provides the ability to easily package your software for Ubuntu, openSUSE (obviously), Red Hat, and others.

    • Robin Wellner / Jun 13 2010 2:11

      The reason Roll is so large is because it is written in C, so they have to do tons of memory management and stuff, along with the fact that C does not have nearly as many useful libraries as Python.

      True, but it is still remarkable that such simple things can differ in size by a factor of 20/40 (depending on whether you count documentation and such).

      This is a fun program, and it is well written.

      Thanks!

      You should try packaging it and getting it up on the Linux software repositories. A could way to do this is by registering your project at the openSUSE Build Service, which provides the ability to easily package your software for Ubuntu, openSUSE (obviously), Red Hat, and others.

      Oh, interesting. I’ll look into it. As mentioned in my post, a large part of my motivation to make dice was to learn how to do things like that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: