Does anyone have any idea where I might find an algorithm to determine a winning poker hand from a group of hands. Preferably something in C or C++ as I am at least able to read that a bit. I am realizing that this is not the least bit trivial...
ID:192608
Jun 5 2002, 5:58 pm
|
|
Jun 5 2002, 6:46 pm
|
|
I'm sure I could write you one, but it'd be in BYOND. I would hope that you could understand it... I just took a $1000 course on writing concise code and constructive comments to improve code efficiency and reworkability. :-)
|
You're asking the wrong bunch... if you need some code that can analyze hands, you should ask gamblers. Just go to a casino and announce that you're looking for a system for counting cards.
|
In response to Lesbian Assassin
|
|
heh
Well, Im not looking for a playing AI, I just want something that can compare a group of hands and declare a winner. I found a diagram of an algorithm, which I'm trying to convert to code. |
In response to Flick
|
|
Well, Im not looking for a playing AI, I just want something that can compare a group of hands and declare a winner. I found a diagram of an algorithm, which I'm trying to convert to code. Drummond Cribbage has code for this, and you could probably use it, or at least the general idea of it. If you like, send me a reminder at [email protected] and I'll send you the relevant code tonight. |
Flick wrote:
Does anyone have any idea where I might find an algorithm to determine a winning poker hand from a group of hands. Preferably something in C or C++ as I am at least able to read that a bit. I am realizing that this is not the least bit trivial... <sigh> I think this'll be a lot easier in BYOND, so here's my whack at it (untested): /* Lummox JR |
In response to Lummox JR
|
|
Yet again, you post a code that make me want to jump off a bridge.
|
In response to Lummox JR
|
|
Hey look! Theres one now.
Thanks Lummox, I'll play with that for a while and see if I can get it working. |
In response to Flick
|
|
Flick wrote:
Hey look! Theres one now. I found a few errors in it when I finally got a chance to compile. I've got it working now, although the sorting on low hands doesn't seem to be quite right. I'll try to tweak it more over the next couple of days. Lummox JR |