# safal-gautamm/cpp architecture

> Architecture diagram of the GitHub repository safal-gautamm/cpp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/safal-gautamm/cpp
- Repository: https://github.com/safal-gautamm/cpp

## Overview

##### Project type and purpose
- This repository contains three small C++ console applications:
- A “main” example (main.cpp)
- A procedural rock–paper–scissors game (rock_paper_scissor/main.cpp)
- An object-oriented rock–paper–scissors game (rock_paper_scissor_oop/main.cpp)
- Each folder is a standalone CLI program demonstrating basic C++ programming patterns.

##### File structure
- Top-level:
- README.md – very high-level title only (“# Cpp”)
- main.cpp & main/ – a simple C++ entry‐point example
- rock_paper_scissor/ – procedural version
- rock_paper_scissor_oop/ – OOP version
- There are no external services, no database or network layers, no build scripts beyond a typical g++ compile.

##### README for additional insights
- The README does not specify dependencies beyond standard C++.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Sample Application
    subgraph "Main Sample App"
        direction TB
        MainEntry["main.cpp (Entry Point)"]:::blue
        MainUI["UI: std::cin/std::cout"]:::blue
        MainLogic["Game Logic"]:::green
        MainUtil["Utility (RNG/helper)"]:::yellow
    end

    MainEntry --> MainUI
    MainUI --> MainLogic
    MainLogic --> MainUI
    MainLogic <--> MainUtil

    %% Procedural Rock-Paper-Scissors
    subgraph "Procedural RPS"
        direction TB
        ProcEntry["main.cpp (Entry Point)"]:::blue
        ProcUI["UI: std::cin/std::cout"]:::blue
        ProcLogic["Game Logic (rule engine)"]:::green
        ProcUtil["Utility (random generator)"]:::yellow
    end

    ProcEntry --> ProcUI
    ProcUI --> ProcLogic
    ProcLogic --> ProcUI
    ProcLogic <--> ProcUtil

    %% OOP Rock-Paper-Scissors
    subgraph "OOP RPS"
        direction TB
        OOPEntry["main.cpp (Entry Point)"]:::blue
        OOPUI["UI: std::cin/std::cout"]:::blue
        GameClass["Game Class"]:::orange
        PlayerClass["Player Class"]:::orange
        MoveClass["Move Class"]:::orange
        OOPUtil["Utility (random generator)"]:::yellow
    end

    OOPEntry --> OOPUI
    OOPUI --> GameClass
    GameClass --> OOPUI
    GameClass --> PlayerClass
    GameClass --> MoveClass
    MoveClass <--> OOPUtil

    %% Click Events
    click MainEntry "https://github.com/safal-gautamm/cpp/blob/main/main/main.cpp"
    click MainUI "https://github.com/safal-gautamm/cpp/blob/main/main/main.cpp"
    click MainLogic "https://github.com/safal-gautamm/cpp/blob/main/main/main.cpp"
    click MainUtil "https://github.com/safal-gautamm/cpp/blob/main/main/main.cpp"
    click ProcEntry "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor/main.cpp"
    click ProcUI "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor/main.cpp"
    click ProcLogic "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor/main.cpp"
    click ProcUtil "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor/main.cpp"
    click OOPEntry "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor_oop/main.cpp"
    click GameClass "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor_oop/main.cpp"
    click PlayerClass "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor_oop/main.cpp"
    click MoveClass "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor_oop/main.cpp"
    click OOPUI "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor_oop/main.cpp"
    click OOPUtil "https://github.com/safal-gautamm/cpp/blob/main/rock_paper_scissor_oop/main.cpp"

    %% Styles
    classDef blue fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef green fill:#90EE90,stroke:#333,stroke-width:1px
    classDef yellow fill:#FFFACD,stroke:#333,stroke-width:1px
    classDef orange fill:#FFDAB9,stroke:#333,stroke-width:1px
```
