This project is a partial implementation of a Solitaire game in C++. The implementation includes:
- A
Cardclass that represents individual playing cards. - A
Deckclass for creating, shuffling, and dealing cards. - War Game Mode (
war_game.cpp) ๐ฎ (Players compete by drawing cards in rounds) - Interactive Mode (
main.cpp) ๐ (Allows drawing, shuffling, and showing hand) - Deck & Hand Management ๐ก (Supports shuffling, drawing, and hand display)
- A
main.cppfile to test basic functionality. - A
test_card.cppfile for unit testing theCardclass. - UML Diagrams explaining the software design.
This implementation is built for a GNU/Linux environment but also works on Windows (MinGW) and VS Code.
solitaire_project/
โโโ src/ # Source files
โ โโโ card.h # Card class header file
โ โโโ card.cpp # Card class implementation
โ โโโ deck.h # Deck class header file
โ โโโ deck.cpp # Deck class implementation
โ โโโ hand.h # Hand class Header File
โ โโโ hand.cpp # Hand class implementation
โ โโโ main.cpp # Main program
โ โโโ test_card.cpp # Unit test for Card class
โ
โโโ diagrams/ # UML Diagrams
โ โโโ class_diagram.png
โ โโโ use_case_diagram.png
โ โโโ sequence_diagram.png
โ โโโ activity_diagram.png
โ
โโโ README.md # Project documentation (this file)
โโโ LICENSE # MIT/GPL License
โโโ Solitaire Game Documentation.pdf # Detailed documentation
This project includes the following UML Diagrams:
This diagram shows the structure of the game classes and their relationships.

Illustrates how the player interacts with the system.

Represents the flow of function calls when the game starts.

Shows the decision flow for game logic.

For Linux/macOS:
cd src
g++ card.cpp deck.cpp main.cpp -o solitaire
./solitaireFor Windows:
cd src
g++ card.cpp deck.cpp main.cpp -o solitaire.exe
./solitaire.exe