I work for a company called Wireless Knowledge where I do a lot of ASP.NET and mobile web stuff, but I never get a chance to write Windows applications. So as a learning experience, I decided to try writing a Blackjack game. I was impressed with the speed of application development. The basics for this game were complete in about 10 hours.

Because it was a learning experience, there are some unnecessary features. But I learned a lot about Windows Forms development in .NET as a result and thought others would find this useful as well.

I wanted to keep the playing area as clutter-free as possible. General controls are located in the status bar at the bottom of the screen. Double-clicking on each of the player's circles will access the user controls.

General Instructions:

Setting the number of players resets all player objects so you should do that before you begin play. You'll initially start off playing spot #1, but you can play as many of the hands as you like by changing the player type to human.

Setting the number of decks creates a new shoe and resets the card counts so you should also set that up before play begins.

You can adjust the speed that the computer players play by changing the delay setting. Also, if you have a faster computer and a nice graphics card, there are two lines of code in the main form paint event that make the graphics slightly smoother if you uncomment them.

Muting prevents the shuffling sound from playing when the shoe requires shuffling and speeds up play since the sound is played synchronously (as it should be, otherwise you hear the shuffling while the cards are being dealt).

Auto Deal relieves you from having to click the Deal button for each hand; however, you won't be given a chance to change your bet. Use this for prolonged practice periods before your trip to Vegas.

The keyboard can be used if you prefer and it makes playing even faster.

D Deal
H Hit
S Stand
B Double Down
P Split

Play Instructions:

Double-clicking in each player's circle brings up a dialog where you select the type of player (human/computer), the playing strategy and the card-counting method.

Each player's circle highlights in different colors during play to indicate the suggested move depending on the playing strategy selected. The colors match the colors of the buttons at the bottom of the screen to make it easy to see what the 'correct' move is.

If no playing strategy is selected, the player's circle will highlight in gold just to indicate which player's turn it is.

The numbers next to each player's circle are (in order from top to bottom):

The suggested bet comes from the card-counting method chosen and will be used by all the computer players automatically. For human players, it is only a suggestion and you need to type that in as your bet if you want to use it.

Rules

Playing Strategies:

Card Counting Methods:

Improvements:

Credits:

I originally borrowed J some card graphics off a gambling site, but then saw Tim Smelser's article in GotDotNet where he loaded the cards32.dll into a resource file and I decided to use that instead so credit to Tim for that. I did add a new card back for the Bellagio Hotel and Casino just to add a bit of class.

*The High-Low playing strategy was pulled from the book "Professional Blackjack" by Stanford Wong so kudos to Stanford for that.