|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Re^2: calculating cribbage pointsby thor (Priest) |
| on Mar 31, 2006 at 10:07 UTC ( [id://540486]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
The thing about scoring mutiples (pairs, 3-of-a-kind, 4-of-a-kind) in cribbage is that it all just breaks down to scoring pairs. 3-of-a-kind is worth 6 points because there are 3-choose-2 pairs (which is 3) in a 3-of-a-kind. Each pair being worth 2 points yields 6 points total. So, using similar techniques as stated already in this thread, one can generate the set of all pairs and if the two elements in the pair are the same, increment the count of pairs.
thor The only easy day was yesterday
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||