New web toy: Mobile dice!
Surely it has happened to you: you’re out somewhere and need a random number, or a whole bunch of them. For me, this mostly happens at restaurants, when I would like to consult an Infallible Oracle as to which of N tasty possibilities is right for me on a given day. But maybe you’re playing Dungeons and Dragons in free-fall (this makes conventional dice less than useful). Perhaps you have found yourself diceless and kidnapped by a capricious yet mathematically sophisticated evil overlord, who will not free you until you have completed a Monte Carlo simulation by hand. I would like to help you, and if you’re that last guy I mentioned, buy you a drink.
Text “rolldice somestuff” to 41411, where somestuff is either a number or a D&D-style specification of how many dice to roll, and how many sides each die has. If you say just one number, you’ll get a reply with a random number between 1 and your number, inclusive, so sending “rolldice 6″ is like rolling a single, ordinary six-sided die; “rolldice 3″ will help you decide among the apple-glazed pork chop, the mahi-mahi on pan-fried noodles, and the five-spice steak. To use a D&D-style dice specification, put a “d” between the number of dice and the number of sides, so you would say “rolldice 3d10″ to get three random numbers between 1 and 10 (”three ten-sided dice”), or “rolldice 3d6″ to roll up your character’s stats old-school in that aforementioned free-fall role-playing scenario.
The way this was done is fairly cool, by the way: I used the free, ad-supported web service TextMarks to handle all the SMS-gateway logic, and then threw together a simple cgi script to handle the dice-rolling logic. Setting aside the time I spent figuring out that my newly-installed FTP client was set up wrong and mangling my script, the whole exercise took less than half an hour, which is nothing short of amazing – TextMarks 41411 is a marvel of simplicity.
