A Blackjack Tournament for CS 112

CS 112 Blackjack Tournament
Professors Paul Haskell and Subbu Subramanian and their CS 112 students during the tournament

For the first big project in this Fall’s CS 112 course, professors Subbu Subramanian and Paul Haskell offered their students the option to develop a Java program that plays the card game Blackjack.  The software did not to give a human player a game to play, but rather acted as a player itself—choosing bets and deciding whether to hit, stand, split pairs, or double down.  Each student’s game communicated in real time over a WiFi network with a central program that acted as the game Dealer. The students’ programs placed bets, received cards, and made plays virtually over the campus computer network.

The evening of November 2nd, all the CS 112 classes combined to hold a Blackjack Tournament.  Over pizzas and snacks, the students pitted their games against each other, and against the Dealer, to see how well they played.  The results were exciting for players and spectators alike.  The students’ programs played almost 100 hands of Blackjack per second, and each game lasted about 10,000 hands.  With initial stakes of $500 each, the software players were able to win and lose over $100,000 per game before the champions finally lost their last chip.  A video shows one game’s progress, with students’ virtual piles of chips growing and shrinking based on their programs’ decisions and the luck of the cards.

CS 112 is the first or second college programming course most students have taken, so this was a particularly demanding project.  Students’ programs ranged from a few hundred lines of Java code to almost 2000 lines.  Most students programmed in Blackjack strategies researched online and tweaked through testing.  The programs counted cards to determine when Blackjacks were likeliest.  One program even developed a Neural Network to decide on the best way to play.