I'm attempting to write a program that recognizes and assigns straights in a hand of cards, both Ace high and Ace low and am stuck
So they way I'm trying to go about it is to create two different methods, one for checking Ace high and one for checking Ace low. The hands are a standard 5 card hand of poker. I'm adding the cards dealt into the hand into an array, then was planning on sorting the array in order of ascending face value. The issue is, I need to sort both for an Ace high and an Ace low, then checking to see if there's consecutive cards in the hand in order to determine if there is a straight. I have no clue how to sort with different values for an ace.
The card faces in the array are stored like "Ace", "Two", ... etc. How do I accomplish this?
Posted Mar 12, 2020, 5:54 AM UTC
12