|There's more than one way to do things|
Generating all 5-card handsby thor (Priest)
|on May 18, 2005 at 14:42 UTC||Need Help??|
thor has asked for the wisdom of the Perl Monks concerning the following question:
So, I've been reading a lot about iterators lately and have wanted to try them out, but haven't had the proper problem arise...until now.
At work, we play cribbage over lunch. For a while, there's been a conjecture that any hand that has a 5 in it has at least two points. We've been unable to prove or disprove it (partly because we're lazy, partly because it's an ongoing joke). What I want to do is write a program that brute forces the issue. That is to say that I want to create a program that scores all 5-card hands that have a 5 in them and see what happens.
Unfortunately, my understanding of iterators starts to get really fuzzy after the most trivial of examples. I'd like to learn how to do this, but I don't know where to start. Does anyone have any pointers?
Feel the white light, the light within