We can identify all the card types and we assign an integer value from 1 - 8 to each hand TYPE(1 being High Card and 8 being Straight Flush).Similarly for Three of a Kind there are three formats: AAABC, ABBBC, ABCCC and we can move the values.Then we move the values in terms of the most valuable digit, so AAAAB -> BAAAA.Four of A Kind can exist in two formats after sorted: AAAAB or BAAAA.We sort the cards to quickly identify the card type. Then we work with numerical values of the cards where 2 to A are represented by integers from 2 to 14. This can quickly identify the type of several hands. There are 7462 distinct poker hands so we created an algorithm that transforms a hand into an integer value.įirstly, we determine if the 5 card combination is suited/straight. To rank cards, we use a hexidecimal system to assign strength to the card from the most most significant card to the least significant card. In order to process data at a fast speed, all Card information are converted into numpy arrays to improve speed.Ĭard inputs are taken in the format of number: 23456789TJQKA followed by suit: dcsh.