CPSC-312-2021/Poker Cards Analyzer

From UBC Wiki

What is the problem?

The Poker Analyzer helps find out what hand rank (royal flush, two of a kind, straight etc.) you have with the given combination of cards. By combining different set of 5 cards, it will tell you what tier you have.

What is the something extra?

The user will have an option to be able to input what cards are in their hands and input what cards are on the table using an I/O interaction. This information will then be merge to stimulate the type of tier. This UI stimulation will work for royal and straight flush, as well as determining two/three/four or five of a kind.

We will also be able to determining what are the next cards needed to get the next tier. For instance, if you are holding flush right now with 2 cards in hand and 3 on the table, it will tell you what the 4th table card has to be in order for u to attain straight flush as there is a 4th and 5th card on the table.

What did we learn from doing this?

Prolog is good with logic and thus categorizing a list of cards easily. We were able to place a combination of cards together to determine the tier

Prolog is a very difficult language to debug as it only allows you to trace the calls. We also struggled with changing a list of words into a list of atoms, which was something prolog was not able to achieve.

Link to code

https://github.com/jillianchiam/CPSC312-Prolog-Project