Tuesday, December 7, 2010

Deck-u-lator JSON API

If you are interested in using Deck-u-lator from other applications, there is a simple interface. You can call the calculator directly from a URL.

http://deckulator.appspot.com/rpc
action=Calculate
arg0 is a JSON expression describing the problem to be calculated. The entire problem is a comma delimited list surrounded by square brackets. Each card type is represented by a two-element list. The first element is the number of cards in your deck. The second element is the number of cards in your combination.
arg1 is the number of cards you draw

The following example requests calculation of drawing 8 cards from a 12 card deck. The deck has three card types. The combination includes one card from the second and third types. The result is returned.

http://deckulator.appspot.com/rpc?action=Calculate&arg0=[[4,0],[4,1],[4,1]]&arg1=8

No comments:

Post a Comment