|
|
SAS Poker Calculator?
Has anyone written a Poker Calculator using SAS? I think that would be
useful. The tricky part is the algorithm that works out who has won.
|
|
0
|
|
|
|
Reply
|
rolandberry (1872)
|
2/7/2011 10:06:27 AM |
|
>"RolandRB" wrote in message
>news:1a874b62-78b3-4bc3-b233->ff199ec048c1@o39g2000prb.googlegroups.com...
>
>Has anyone written a Poker Calculator using SAS? I think that would be
>useful. The tricky part is the algorithm that works out who has won.
The basic algorithm would be the same in any language. Yes, it'd take time
to write the code but all you need to do is to assign each player a rank
based on their cards. For Royal Flush (I think that's the best cards),
you'd assign rank of 1 and next highest combination would receive the rank
of two, and so on.
|
|
0
|
|
|
|
Reply
|
Kenneth
|
2/7/2011 6:50:01 PM
|
|
On Feb 7, 7:50=A0pm, "Kenneth M. Lin" <kenneth_m_...@sbcglobal.net>
wrote:
> >"RolandRB" =A0wrote in message
> >news:1a874b62-78b3-4bc3-b233->ff199ec04__BEGIN_MASK_n#9g02mG7!__...__END=
_MASK_i?a63jfAD$z__@o39g2000prb.googlegroups.com...
>
> >Has anyone written a Poker Calculator using SAS? I think that would be
> >useful. The tricky part is the algorithm that works out who has won.
>
> The basic algorithm would be the same in any language. =A0Yes, it'd take =
time
> to write the code but all you need to do is to assign each player a rank
> based on their cards. =A0For Royal Flush (I think that's the best cards),
> you'd assign rank of 1 and next highest combination would receive the ran=
k
> of two, and so on.
Yes, but how to detect a straight flush with Ace high and all the
others scoring hands? I can't think of an easy way.
|
|
0
|
|
|
|
Reply
|
RolandRB
|
2/7/2011 9:45:48 PM
|
|
> "RolandRB" wrote in message news:d2dc1d79-58a9-4928-b30a->
> d7a7ef156d3a@r16g2000yqk.googlegroups.com...
> On Feb 7, 7:50 pm, "Kenneth M. Lin" <kenneth_m_...@sbcglobal.net>
> wrote:
> > >"RolandRB" wrote in message
> > >news:1a874b62-78b3-4bc3-b233->ff199ec04__BEGIN_MASK_n#9g02mG7!__...__END_MASK_i?a63jfAD$z__@o39g2000prb.googlegroups.com...
> >
> > >Has anyone written a Poker Calculator using SAS? I think that would be
> > >useful. The tricky part is the algorithm that works out who has won.
> >
> > The basic algorithm would be the same in any language. Yes, it'd take
> > time
> > to write the code but all you need to do is to assign each player a rank
> > based on their cards. For Royal Flush (I think that's the best cards),
> > you'd assign rank of 1 and next highest combination would receive the
> > rank
> > of two, and so on.
>
> Yes, but how to detect a straight flush with Ace high and all the
> others scoring hands? I can't think of an easy way.
It really depends on how you organize your data. What's stopping you from
sorting the cards first by the face values?
You have a flush if, after you ordered the cards in increasing order, a card
has face value that is one less than the next one. It could be done in one
long IF statement in brute force or you could use an array.
|
|
0
|
|
|
|
Reply
|
Kenneth
|
2/7/2011 10:50:01 PM
|
|
|
3 Replies
109 Views
(page loaded in 0.072 seconds)
|
|
|
|
|
|
|
|
|