lane straatman <gr**********@n etzero.netwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Bill Reid wrote:
lane straatman <gr**********@n etzero.netwrote in message
news:11******** **************@ 79g2000cws.goog legroups.com...
pete wrote:
LS: fishing for hints on representing a poker game
>
As is usually the case, it turns out he was looking to solve
Fermat's Last Theorum and asked how to add 2+2...
It was only a century back that logicians proclaimed that "arithmetic
teeters."
Math can be pretty wacky...read the history of "probabilit y theory"
and compare it to what we know now for some good laughs, and those
comedians are/were the renowned mathematicians of their day...
Consider the hand as an array.
Sort the array, and check for equality in consecutive elements.
Paul Hsieh wrote a program that I like,
which fully evaluates poker hands and scores them.
This is one that I wrote:
/* BEGIN shuffle.c */
#include <stdio.h>
[main and beyond snipped for brevity]
Thanks all for replies and in particular pete for his generous post.
I'm a mile away from a compiler now, so I can't step through it, but
it
looks as clean as a whistle.
>
Well, as one of my "mentors" on one of my first jobs said, "if it
looks good, it must be good"...
I really do prefer my object-oriented C++ card-playing classes
myself...
What is it that you gain from OO?
The ability to write simulators for new games without re-creating all
the code for "cards", "deck of cards", "card table", "dealer", "players",
etc. Basically, I can just write a new "game" class with some new
"strategy" tables and I'm done...
One thing I want to do is to be able to calculate is how much of a
difference it makes in the odds when a card gets flipped up, which
happens fairly frequently in real life, and on which I have no numeric
handle. A card flipped up during the deal--in Western
Michigan--becomes the burn card. I'm unaware of how universal this
practice is. An upturned burn card would differ from the usual, I
should think.
>
It's just a card that can never be drawn to the community cards or
to a player's hand, so you remove it from the deck remainder that
you evaluate using combinatorial analysis...oh wait, are you writing
a combinatorial analyzer, or a "Monte Carlo" simulator, or
perhaps a simulator that can call in a combinatorial analysis
at any time, or what?
Monte Carlo is the short answer. I'm only able to do combo with pen
and paper. It's nice to have a computer tell you that you've got the
correct answer.
Ah, yes, once again, check the history of "probabilit y theory" and
note it only really "gelled" as the result of empirical studies, which is
greatly aided these days by high-speed computer simulations. Las
Vegas exists because of the laws of probability but the casino owners
didn't (and still largely don't!) know the laws, they only kind of know
"what works" (note that even after Dr. Thorp calculated the "odds"
of a hand of blackjack, they STILL didn't really understand the
game they were offering)...
Of course, if you able to do the calculation with "pen and paper",
you can do it with a computer, but you admit you don't really trust
your math skills. So you want to simulate the game and compile
the statistics to see what really happens. So what you really want
is not a full poker simulator, but a more limited simulator that just
checks the hand completion results after a particular card is "seen".
Be aware that you'll have to run many billions of trials for each
of the possible combinations of your dealt cards and the "seen"
card in order for the varying results to resolve to a statistically-valid
"expectatio n" number.
More than anything though, I like to see a scenario,
say, that you're dealt a pocket pair and see how the bidding might go
given tight/loose players, short/tall stacks and position.
OK, that's a full simulator. You're dealing with a lot more variables
there, and getting into some of the more "intangible/chaotic" aspects of
poker, given that in real life, "tightness" and "looseness" can and do
vary themselves as player "psychology " changes. The "bidding"
itself is dependant on YOUR "tightness" or "looseness" in many
situations.
In addition to biting off more than you can chew coding- and
game theory-wise, you may be asking a question that already
has a better strategic answer, if your goal is just to learn how
to win at poker...
Right now,
I array the cards and "players" on my desk and try to do the odds
analysis.
Of course, you can "see" the other player's cards, which is a tremendous
advantage you only sometimes get in a real game!
In real life, I'm having trouble playing with loose players
on tall stacks in cash games. The burning question there is usually
just when to push all in.
Yeah, those pesky "real-life" players will do it to you every time!
Here's a well-known clue: NOBODY can win in a truly "loose"
game. Here's the (duh!) strategy: DON'T PLAY IN THOSE
GAMES. Problem solved!
Of course, it is also impossible to win in a truly "tight" game
either. The general strategy for winning consistently at poker
thus reduces down to choosing your opponents (ideally,
"loose/scared"), not trying to figure out how to win in games
where nobody has a chance of winning.
---
William Ernest Reid