Skip to main content
GameDev.net gamedev.net
🔒 Locked

Card Solver

Started by Asheh Jan 20, 2006 at 4:39 AM 0 replies 400+ views
Original Post
Asheh
Asheh
Ive never created anything before which requires "searching" for every possibility. So im not really sure how to do it. I have 5 cards on each row. Where there are 5 rows in total. Any single card on each row can be matched up with any card on another row to make a poker hand. I need to search for the best possible poker hand based on this. Any advice? Cheers Ash
u235
u235
You could make a hand data type that stored the values of the 5 cards in the players hand, then just loop through all the possible combinations and use some simple logic statements to figure out what that hand is. Whatever hand comes out being the best, that's what you're looking for. Granted, there's 9 different hands you could have so that's alot of logicizing, but it would work, hopefully [grin]. Anyway, hope that helped and anyone else please feel free to correct me, slap me around, or whatever if I did it the wrong way.

-AJ
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.