This **is** for homework. The code below, that I modified, does the first part of the job and gives me two hands for 5 card poker.
Column 1 is Hand 1 and column 2 is hand two.
How can I evaluate it now and determine whether the hand holds a pair, two pairs, three of a kind, etc?
The professor suggested an array to handle it but I know that we are not supposed to pre-suppose the solution with questions like this.
Any help that you can give me would be most appreciated. Thank you.
turn of your computer. Get some paper, some pencils, and some erasers. Start writing down directions as if you were explaining to a child how to evaluate a poker hand. then, revise them. Then revise them again.
I would plan on having several methods. For example, have a method that figures out if you have a flush. Have a method that figures out if you have a straight. Note that these two methods are 100% independent of each other. Once you have those done, then to determine if you have a straight flush, you call both methods and see if they are both true.
In any case, do not write a single line of code until you have steps in clear, plain English, written out on your paper.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors