Skip to content

Latest commit

ย 

History

History
79 lines (66 loc) ยท 2.65 KB

Readme.md

File metadata and controls

79 lines (66 loc) ยท 2.65 KB

Solitaire Game (Partial Implementation)

๐Ÿ“Œ Description

This project is a partial implementation of a Solitaire game in C++. The implementation includes:

  • A Card class that represents individual playing cards.
  • A Deck class 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.cpp file to test basic functionality.
  • A test_card.cpp file for unit testing the Card class.
  • UML Diagrams explaining the software design.

This implementation is built for a GNU/Linux environment but also works on Windows (MinGW) and VS Code.


๐Ÿ“‚ Project Structure

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

๐Ÿ“Œ UML Diagrams

This project includes the following UML Diagrams:

1๏ธโƒฃ Class Diagram

This diagram shows the structure of the game classes and their relationships. Class Diagram Class Diagram

2๏ธโƒฃ Use Case Diagram

Illustrates how the player interacts with the system. Use Case Diagram

3๏ธโƒฃ Sequence Diagram

Represents the flow of function calls when the game starts. Sequence Diagram

4๏ธโƒฃ Activity Diagram

Shows the decision flow for game logic. Activity Diagram


โš™๏ธ Build & Run Instructions

โœ… Compile and Run Main Program

For Linux/macOS:

cd src
g++ card.cpp deck.cpp main.cpp -o solitaire
./solitaire

For Windows:

cd src
g++ card.cpp deck.cpp main.cpp -o solitaire.exe
./solitaire.exe