This is a C++ implementation of a custom poker game. The game follows specific rules where players draw cards, make claims about their hands, and can challenge each other's claims.
The project consists of the following files:
main.cpp
: The entry point of the programgame.cpp
/game.h
: Defines the main game logicplayer.cpp
/player.h
: Represents a player in the gamedeck.cpp
/deck.h
: Manages the deck of cardshand.cpp
/hand.h
: Represents a player's handcard.cpp
/card.h
: Defines individual cards
This project uses CMake as its build system. To build the project:
- Make sure you have CMake installed (version 3.13 or higher)
- Navigate to the project root directory
- Create a build directory:
mkdir build && cd build
- Generate the build files:
cmake ..
- Build the project:
make
After building, you can run the game by executing the poker
binary in the build directory:
./poker
The game follows these rules:
- The first player draws 2 cards.
- They state a poker hand they claim to have and pass the cards to the next player.
- The next player can either: a. Believe the claim and draw 0, 1, or 2 new cards, then make a stronger claim. b. Challenge the claim. If the hand is worse than claimed, the previous player is out. Otherwise, the challenging player is out.
- Each time the hand is passed, the claimed poker hand must be stronger.
- A 2 is considered a joker, and 7-2 is the best possible hand.
Contributions to this project are welcome. Please ensure you follow the existing code style and include appropriate tests for any new features.
This project is licensed under the MIT License. See the LICENSE file for details.