Thursday, September 13, 2007

Developers Toolkit

A proof of Card Counting for the game of BlackJack is quite simple: a text-based application could simulate a dealer playing standard Las Vegas rules with a table full of players using Card Counting strategies to fix their bets, and any sort of strategy to determine their playing style.

The simulation that I have in mind would run for 10,000 hands with a table of four players. A successful proof would show that after 10,000 hands, each of the players has increased their personal stash of cash by a substantial margin. In a casino, the pit boss would surely suspect some inequity if four players played 10,000 hands at once, all draining cash out of the bank.

To win at blackjack, my experience has been that it is possible to read a table rather than sitting for 10,000 hands, and to simply pick a winning table before sitting down. How exactly do you read a table? If I make my millions in a casino, then I will write a book and tell exactly that. My training is as a programmer, so today we will play Hack the Planet instead.

It would be nice to produce a playable game with a graphical interface as well; an efficient simulation could probably play 10,000 hands in a matter of seconds, but we wouldn't get to play or watch the dealing happen; how unrealistic! One of the goals of this project will be to produce a graphical player interface to show at least the cards on the table.

For a good simulation, our program should allow an individual player to carry a card or two around with him, and optionally depending on the various data protection that is in place, to pick up and put down cards. In a casino, the dealer is the only one dealing, and there is one dealer per table, so our simulation will make some accounting for the possibility to cheat.

Tools for the developer:

  • Subversion—Some simple revision control software that enables neat tricks like distributed development teams. This one is free, compare to PlasticSCM for a commercial alternative built exclusively using C# and Mono.
  • Vim—A text editor is necessary to write code or documents in any language. Vim is a modal text editor. Explicit instructions from Axel, please don't write your code in Word! Compare to Acrobat Professional for a commercial alternative with a print focus.
  • WebSVN—I use this to put an interface on top of the code. Does anyone want to take a look at the changes over time to your Subversion code base? It's easy to do, you can even subscribe to the updates with an RSS reader.
  • Interface Builder—Lay out your interface using Cocoa .nib files, and load them from inside of your application to get a player interface set up. This is the only part that should not translate to Windows and .NET proper as it is defined by Microsoft.
  • C# Code—This is another attempt at a BlackJack simulation. This code failed to compile in the latest Visual C# from Microsoft, and I suspect that it is pretty old. Still helpful to establish the game logic including some graphics that can go in the Cocoa UI.
Finally the various cards and card piles should be represented as XML data so that this development effort has a chance to satisfy Axel's requirements and earn some course credit for my degree. Still anticipated is a chip counter, as well as simulations of Poker and Hokm.

No comments: