For anyone who knows me, they know I'm a bit of a tabletop gaming nerd. I've played a lot of Dominion, but I recently picked up the Penny Arcade game. I've used randomizers for Dominion for a long time (dealing with the randomizer cards kind of sucks), but I couldn't track down a randomizer for Penny Arcade. Since there was a lack of randomizer, I decided to hack one out really quick one day.
The randomizer is pretty simple and is laid out to be used from a mobile device. Again, this is pretty hacky. If you want to use it, just go to http://pa.splitstreams.com. It's a super-simple page that just has a bit of javascript to hit a CGI script that generates some JSON.
If anyone is interested in using just the “API”, feel free to do so. It is just a cgi page that takes some options and returns some JSON. The base “API” CGI lives at http://pa.splitstreams.com/pa.cgi. Here are the different query string options:
Key | Values | Description |
---|---|---|
gset | 1 (Gamers vs. Evil) or 2 (Rumble in R'lyeh) | The gset corresponds to the game set you want to include in the results, if nothing is specified for this, it defaults to “1” (Gamers vs. Evil). This can be specified multiple times to randomize from multiple sets |
gold | 1 | If you include this key, it will add gold cards to the mix. Note that adding gold cards automatically implies gset=2 (Adding Rumble in R'lyeh) |
bal | 1 | If you include this key, it will balance the red and green cards that are used |
pp | 1 | This is mainly used for testing/debugging. It will “pretty print” out your results |
jsonp | str:callback | The name of the callback is used for a JSONP response |
callback | str:callback | An alias for jsonp |
As you can see, this is pretty simple. If you want to generate a JSON response with all options set, just do http://pa.splitstreams.com/pa.cgi?gset=1&gset=2&gold=1&bal=1&pp=1.
There is also an “allow any” header for CORS support as well.
If anyone is actually interested in getting the source for this, let me know. It's not very good (one more time, totally hacked this out one afternoon), but just send me an email and I could add it to github or something. Otherwise, use the site/API as you desire.