Hi, I've been trying to make a poker game, i got the basic things running like giving the cards to the player and dealer, but i am having trouble coming up with a way to compare the 2 hands... I'm new to python, i tried different ways and didn't really work out.. Right now i have the cards put in order. Can someone please tell me a good way to compare the hands between the player and dealer >< that will be great. Thanks
yari 0 Newbie Poster
Recommended Answers
Jump to PostI think he meant scores as in rank
Like a flush is worth more then a pair.
Jump to PostDon't use 'list' as a variable. It is a built-in function.
I rewrote your function to make it more readable. However, without the complete code, I don't know exactly how I can helpdef straightFlush(list1): number = int(list1[0][0]) suit = list1[0][1] count = number print "number is", …
Jump to Post...And here's my definition of class Card, along with a very minor exercise
class Card: """ A standard poker card with suit and value Value is intended to be an integer for easy sorting and comparison Suit can be anything. Test code uses a single capital letter …
Jump to PostdealerHand =
Two Queen of Hearts for dealer? I wonder what hand that makes ;)And, Yes, please do not use list for variable name as function list from python becomes unusable (hidden) after that.
All 13 Replies
griswolf 304 Veteran Poster
yari 0 Newbie Poster
redyugi 5 Junior Poster in Training
yari 0 Newbie Poster
redyugi 5 Junior Poster in Training
yari 0 Newbie Poster
griswolf 304 Veteran Poster
griswolf 304 Veteran Poster
yari 0 Newbie Poster
griswolf 304 Veteran Poster
yari 0 Newbie Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
yari 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.