Is Python for me?

J

jiddu

Hi,

I'm planning to create a poker calculator, I learned some basic in
highschool years ago and I was told for beginners Python is a good
language to start.

What I wanted to do is to first write a program which will be able to run
through all the possible combinations of cards dealt out and use some
counters to calculate different probabilities at different stages. Since
that is a lot of data I think I have to store it in some kind of database
or spreadsheet type thing?

Then I wanted to write a simple user interface so I could use my mouse to
make selections of cards that I am dealt and that come on the flop and how
many opponents and have the program find the calculated information and
display it on the screen.

I am wondering if I learn to use Python will I be able to write something
like this? My friend studied some C in college so I thought I'd learn C++,
turns out it is a very complicated language so I thought maybe I should try
something else before I commit more time to the language.

Thank you very much in advance
 
J

James Stroud

jiddu said:
Hi,

I'm planning to create a poker calculator, I learned some basic in
highschool years ago and I was told for beginners Python is a good
language to start.

What I wanted to do is to first write a program which will be able to run
through all the possible combinations of cards dealt out and use some
counters to calculate different probabilities at different stages. Since
that is a lot of data I think I have to store it in some kind of database
or spreadsheet type thing?

Then I wanted to write a simple user interface so I could use my mouse to
make selections of cards that I am dealt and that come on the flop and how
many opponents and have the program find the calculated information and
display it on the screen.

I am wondering if I learn to use Python will I be able to write something
like this? My friend studied some C in college so I thought I'd learn C++,
turns out it is a very complicated language so I thought maybe I should try
something else before I commit more time to the language.

Thank you very much in advance

Yes, use python, you will get the most return on your learning effort,
though some learning is required. Start at python.org -> docs -> tutorial.

James
 
A

azrael

i hope you know that for this task, if you want it to be successfull,
you need a really big database. it sounds very simple to this. it
sounds like go through all possible permutations. before you start
writing any code take a pencil and a big paper and do some maths. i
sugesst you read and practise this for about a year about data
structures, algorithms and graph theory (just for the begining). Then
take a look on data mining and then incpect the era model so you can
design a good database.
Tic Tac Toe is a much easier problem and there are a lot of possible
different games (9*8*7*6*5*4*3*2*1=362 880 i dont consider the
rotations).

it's true that you learn best by solving a problem, but if stoped on
basic on higjschool, then you will need a lot of time to solve this
problem. If you remember basic than you should learn python according
to basic's possibillities in maximum a month. depending on talent and
spare time.

i sugesst you take some a "a little bit" easier problem to learn
python.

For this speciffic problem it shold be good to learn on other games. I
started about 7 years ago on tic tac toe and then with reversi.

You are from USA? I come from a differtent continent so i don't know
what you learn in schools. But if you didn't learn it, take a look on
statistics. very usefull. you should at least know what specific terms
mean althought python has them in the numpy module.

don't be afraid of all that i said. keep learning and it will pay off.
at the end when you crack the poker machine :)
that's the life of a geek. learn , learn, learn and one day comes the
jackpot.
 
N

Neil Cerutti

Hi,

I'm planning to create a poker calculator, I learned some basic
in highschool years ago and I was told for beginners Python is
a good language to start.

Python *is* a good language to start.
What I wanted to do is to first write a program which will be
able to run through all the possible combinations of cards
dealt out and use some counters to calculate different
probabilities at different stages. Since that is a lot of data
I think I have to store it in some kind of database or
spreadsheet type thing?

Unfortunately, that is a very *difficult* problem; no programming
library (save a hypothetical poker probability library) can make
it easy.
Then I wanted to write a simple user interface so I could use
my mouse to make selections of cards that I am dealt and that
come on the flop and how many opponents and have the program
find the calculated information and display it on the screen.

I am wondering if I learn to use Python will I be able to write
something like this? My friend studied some C in college so I
thought I'd learn C++, turns out it is a very complicated
language so I thought maybe I should try something else before
I commit more time to the language.

Python can help you with creating an user interface, and with
several simple, powerful data structures. I think you ought to
lower your ambition a bit, at first. Firts write a program to
rank complete sets of poker hands. That should hold you for a
while.
 
J

jiddu

Thanks for all the input guys, I know it is difficult, but the calculators
and statistic sites/books are missing some things which I need for my play
so I guess I have no choice but to study up and work.

When I was learning C++ I wrote some code to calculate simple things like
probability of 1 or more player to have pocket pair in 9 handed game, its
not finished but I realised I need to use some kind of database and
someone suggested to me try python because it will be easier to learn.

Again thanks for the help guys
 
G

Grant Edwards

Thanks for all the input guys, I know it is difficult, but the
calculators and statistic sites/books are missing some things
which I need for my play so I guess I have no choice but to
study up and work.

You're most welcome.

Though I really have no idea whom you're thanking or for what
you're thanking them [a situation remedied by posting your
thank-you as a follow-up to the relevent thread], it would be
rude for nobody to acknowledge your thanks. ;)
 
Joined
Jun 20, 2008
Messages
1
Reaction score
0
Python is a great language. But this is a very challenging problem. My suggestion is to cheat and calculate the odds empirically. Write a program that compares two poker hands and sees which one wins. Then have a program play a few thousand hands. I wrote a program that did this once and it proved accurate to within one percent. It also allows for some more advanced calculations that would be extremely difficult to do mathematically (for instance, for the cards I am dealt what are my odds of winning at a table with 3 people vs 6, your odds of winning for some hands are more than cut in half when the number of people doubles).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top