LA Coding Dojo, May 9, 2012
-- Blackjack Reloaded!
We're carrying last time's challenge over to tonight. To review, your task is to build a blackjack player with a winning strategy against a casino dealer. Your player interacts with the dealer through a RESTful Web interface hosted at http://dojo.v.wc1.atti.com/. Here is the API:
Show the "leaderboard".
GET /players
Create a player with the given nickname.
POST /players?nick=<nick>
Get the player with the given nick.
GET /players/:nick
Show the blackjack tables.
GET /tables
Sit at a table (opposite a dealer) who draws from a stack of n decks of cards shuffled together. If you don't provide the "decks" parameter it defaults to 1.
POST /tables?nick=<nick>[&decks=<n>]
Get the table with the given table id.
GET /tables/:tableId
Draw a card.
PUT /tables/:tableId/hit
End your turn.
PUT /tables/:tableId/hold
Start a game with the given bet.
PUT /tables/:tableId/startGame?bet=<bet>
We're playing with simplified rules: no double-down, no split, no insurance. The dealer holds on 17. To review the rules, peruse the Wikipedia article. Please post the URL to your solutions in the comments below. Good luck!
Nate, KK, Benson 's solution, does card counting, winning consistently :
https://github.com/kaykay/ladojo7-blackjack