"Today, I want to talk about card games… On a recent trip home, I had an opportunity to teach my fiance how to play one of my favorite card games. Cribbage. If you are unaware, cribbage is a game in which each player (or team, as the case may be) attempts to score the most points during several rounds. The goal is to be the first team to 121 points. The scoring system and play are somewhat complex, so I’ll just direct you to the wikipedia entry [1] for cribbage, but suffice to say that the game is quite fun. I’ll assume that the reader understands the scoring rules for cribbage for the rest of this post.
While we were playing, we came across several hands which were very difficult to count. For instance, consider the hand:
A-H 2-H 3-H 4-H (5-H)
where
Like writing my own.
Therefore, I present to you, in only around 200 lines of Haskell, a full library for playing card-like structures, complete with shuffling, dealing, and permutation-irrelevant equality, as well as a cribbage score counter which uses this library for counting cribbage scores…"
Read full post here.
No comments:
Post a Comment