This project aims to simulate and analyze poker hands, focusing on Object-Oriented principles. The key components are:
-
Deck Class: Manages a deck of cards, allowing shuffling, dealing, and card retrieval.
-
Card Class: Represents individual playing cards with suit, rank, and utility functions.
-
CardHand Class: Represents a player's hand, allowing the addition of cards.
-
CardHandScorer Class: Analyzes a player's hand, determining the Poker score based on various criteria.
-
PokerScore Class: Holds and manages different Poker scores for a hand, including a flexible scoring system.
-
Randomized Card Dealing: The program deals cards to simulate various poker hands.
-
Scoring and Analysis: Utilizes the CardHandScorer class to evaluate Poker scores for each hand dealt.
-
Probability Analysis: After simulating a significant number of hands, the program outputs the frequency of each Poker score, providing insights into the probability of different hands.
-
Graphical Representation: A class is implemented to visually represent poker hands, illustrating the odds of getting each hand after running the simulation multiple times.
The project demonstrates the design and interaction of classes to model a poker game. Additionally, it provides a tool for analyzing the probability of various poker hands, contributing to a deeper understanding of the game's dynamics. The graphical representation enhances the user experience by presenting the information in a visually accessible manner.
The program outputs the frequency of each Poker score after running simulations, providing insights into the likelihood of different hands in a poker game.