Code Kata - Texas Hold'Em

Time for another in my Kata series. I enjoy a bit of Poker, especially Texas Hold'Em, so this Ruby Quiz caught my eye. Here's the essence of the problem:

You work for a cable network and the show's producer has come to you for a favor. It seems the play-by-play announcers just can't think very fast. They could certainly flap their jaws well enough, if they just knew what hands the players were holding and which hand won the round. The producer explains what you need to do:

Players hands consist of a simple space-delimited set of pair of characters: each pair representing the face value of the card and the suit.
When a player folds, the hand only consists of the cards until the fold.

For example, consider three players, Bob, John, Sue:
Bob: Kc 9s Ks Kd 9d 3c 6d
John: 7s Ts Ks Kd 9d
Sue: 9c Ah Ks Kd 9d 3c 6d

This would mean John would have folded and Bob and Sue were left in the showdown. The required output would show:
Bob: Kc 9s Ks Kd 9d 3c 6d Full House (winner)
John: 7s Ts Ks Kd 9d
Sue: 9c Ah Ks Kd 9d 3c 6d Flush

It would also be nice to also show the cards rearranged to show the 5 cards included in the ranking (i.e. the 5 flush cards Sue had) and also sorted by face value, with any kickers sorted as well.

This is actually a fairly complicated problem for a Kata but I can't resist, so I'm going to forge ahead. I need to pick a language for the Kata. I've done one in C# and Scala and do want to continue my adventures in Scala, but this feels like it may be too big a jump after the simple one I started out with, so I'm going to pick Java. The last decision at this stage is whether I should make use of 3rd party libraries. I think at this stage, I'm going to stick to what comes "out of the box" in JDK 6, but may review that decision later on.

Lastly, I think it will turn out to be too big to simply post all the code here, so will take this opportunity to use one of the newfangled distributed version control systems. The two obvious choices being Git or Mercurial. I'd be tempted to use Mercurial as I've heard it's the more friendly to users of Subversion (which I use daily). However, it seems all the geek love is for Git - especially Github - so will start there.

I do plan on posting code snippets here as I go through the process, focusing on the tests/refactoring decisions I make as I go. This should be a good one!


Comments:

Just curious (because Open MPI is in the slow osrceps of migrating from SVN to Mercurial): is your favoring of git because you long-ago made the mental leap from centralized VCS's to DVCS's, and therefore the mental delta (no pun intended) from Mercurial -> Git was fairly small?I have always thought of svn, hg, and git as somewhat of a linear spectrum: svn at one end, hg in the middle, and git at the other end. hg and git are both DVCS's and fairly feature-comparable, but hg's commands are much closer to svn's, making it easier for cvs/svn dinosaurs (like me) to switch to hg (compared to switching to git).I use git about once every 6 months (typically interacting with someone else's project) and it always confuses the heck outta me. The next time I use it is just long enough later that I forgot everything I learned the previous time. Plus, 95% of my day is still comprised of working with SVN (read: a non-DVCS), so all the concepts are not kept fresh in my head. So I have mental models in my head that git is extraordinarily complicated and difficult to learn, and that Mercurial although it's a DVCS is much closer to the stuff that I currently use every day, and therefore is much easier for me to learn and migrate to.So my question to you is: do you think your experience / bias / whatever is that it's a natural evolution from CVS -> SVN -> Mercurial -> Git? (vs., for example CVS -> SVN -> git)Also, what motivated you to look (again) at VCS's and move to a new one? Is Mercurial somehow deficient for your requirements / needs? You mentioned that git seems a little easier to make new projects do you do that often such that it's worth the mental delta to learn a new system (and genuinely be more productive)? And/or even since the mental leap from SVN -> Mercurial is clearly long-since overcome and there's nothing new you need to learn to do what you need to do with Mercurial, what makes git better such that it makes the git mental bootstrapping worth it?(keeping in mind that all of these questions may be attributed to the fact that I have a [potentially inaccurate] complex model of git in my head, as described above)Thanks!


Comment Guidelines
See the FAQ for details on the full rules and guidelines. No Spam. Write clearly and thoughtfully - no bad language.