Project: Poker Hand Classifier
As I gained interest in card games, I looked more and more into educated gambling; it's no wonder that Texas Hold Em caught my attention. I wanted to be able to use computing power to help make the correct decisions during poker play, and so I started out with what I thought was a relatively easy exercise of writing a "poker hand classifier"
Now don't get me wrong, this is no Nobel Prize winning ActionScript code, but it took me well over 15 hours to write a bug-free poker classifier. For those of you who are computer-minded, think about the high-level algorithm first. Here are a few questions to get you started.1) Let's say there are 5 community cards and 2 private cards, how can we pick the "best" 5 cards?
2) Let's say we have our 5 best cards, think of an explicit algorithm to classify this hand into a known poker hand.
3) Given two 5-card poker hands, what is the best way to determine which hand would "win" if those were hands at showdown?
4) Given a set S and an integer k ≤ |S|, find a decent algorithm to produce all k-sized subsets of S.
These questions should get you thinking along the right path to choose the data structures you need to approach this problem (don't forget about kickers!)