February 10, 200718 yr Hi, I'm stuck with a ormula and although I can get it to work using loads of if statements I'm hoping there is a easier way. Basically as a practice project I want to make a program that can work out the best poker hand from data entered. I've got all my fields set up (flop1, flop2, river, etc) and I have used the case statement and lots of AND and OR's to get it to pick up pairs, trips, etc but I'm thinking there must be a easier way than listing all possible combinations? Also I can't think of how I would use this method to pick up the straights, etc. So far I have not included suits. just numbers. Any ideas?
February 11, 200718 yr You've got your work cut out for you. What work have you done so far? I suspect it'd be a lot easier with a Custom Function, but it doesn't seem you have a copy of Advanced. So you'll need some scripts to massage the data. I'd go about this from two directions: 1) Breaking up the data into a format usable to conduct evaluative calculations. A carriage delimited list of the values of the cards sorted and a carriage delimited list of the suits of the cards (for flushes and straight flushes). 2) Determing how to evaluate the data. I'd create a blank calc field for each Hand Ranking and then work on each ranking individually. PatternCount will be useful, as will Max. Hand rankings are exclusive, so your final Case statemet would be evaluate your calc fields in order for Straight Flush, then Four of a Kind, then Full House, down to High Card.
February 12, 200718 yr Author thanks a lot. well explained and very helpful. Think it might be out my range right now, but i'm gonna give it a go
Create an account or sign in to comment