in reply to Pattern Matching Query
Update: Added missing brackets and an afterthought at the bottom. And corrected the error blakem pointed out below.
You don't need a regex, a simple index will do fine. This has the additional benefit that $run will give you a comparative value for determining the value of the hand.
if (($run = index('abcdefghijklm', $sorted_values,0)) > -1) { # Do stuff... }
In fact, if you arranged for your sort of the cards to sort aces above kings, then you could use the $run values to determine which run has the higher scoring value. (I think. I'm not much of a card player :^)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Pattern Matching Query
by blakem (Monsignor) on Sep 17, 2002 at 12:55 UTC |