Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking for different ways how to recognise whether a set of cards sufficiently fulfills a requirement. It's for an obscure game you probably don't know, so for sake of discussion let's talk about Poker instead, whose basic hands are well-understood by many people.
For instance, let's stringify our hand to '♥9 ♥9 ♠J ♠J ♠J' so we can operate on it. I want to find out whether that is one of the winning hands (it is) and which one it is (it's a 'Full House'). Before I spend too much time going down dead ends, are grammars a good approach for that sort of problem? If not, what else can you recommend for the general case? Need not be something complete from CPAN, pointers to suitable Web search terms are welcome, too.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is Regexp::Grammars a suitable tool for recognising card game hands?
by holli (Abbot) on Aug 08, 2009 at 22:35 UTC | |
|
Re: Is Regexp::Grammars a suitable tool for recognising card game hands?
by JavaFan (Canon) on Aug 08, 2009 at 23:29 UTC | |
|
Re: Is Regexp::Grammars a suitable tool for recognising card game hands?
by jethro (Monsignor) on Aug 09, 2009 at 12:38 UTC | |
|
Re: Is Regexp::Grammars a suitable tool for recognising card game hands?
by moritz (Cardinal) on Aug 09, 2009 at 10:19 UTC |