# megatron10/solve-you-a-game architecture

> Architecture diagram of the GitHub repository megatron10/solve-you-a-game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/megatron10/solve-you-a-game
- Repository: https://github.com/megatron10/solve-you-a-game

## Overview

##### Main Components

a) Core Framework Layer:
- Solver Engine (src/Solver.hs)
- Game Play Manager (src/GamePlay.hs)
- Game Runner (src/RunGame.hs)

b) Games Implementation Layer:
- Individual Game Implementations
- Chomp
- FrogPuzzle
- TicTacToe
- TwentyOne

c) Testing Layer:
- Game-specific tests
- Main test suite

##### Specific Elements

a) Core Framework:
- Game Type Class (from Solver.hs)
- SolvableGame Type Class (from GamePlay.hs)
- Solver Engine
- Game Play Manager

b) Implementation Layer:
- Individual game modules showing their relationship to the Game and SolvableGame type classes

c) Testing Components:
- Relationship between each game and its corresponding test module

##### Additional Details

Annotations for:
- Stack build system integration
- CircleCI integration
- Documentation generation path

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph EntryPoint
        Main["Application Entry Point"]:::entry
    end

    subgraph CoreFramework
        Game["Game Type Class"]:::interface
        SolvableGame["SolvableGame Type Class"]:::interface
        Solver["Solver Engine"]:::core
        GamePlay["Game Play Manager"]:::core
        GameRunner["Game Runner"]:::core
    end

    subgraph GameImplementations
        Chomp["Chomp Game"]:::game
        FrogPuzzle["Frog Puzzle"]:::game
        TicTacToe["Tic Tac Toe"]:::game
        TwentyOne["Twenty One"]:::game
    end

    subgraph Testing
        MainTest["Main Test Suite"]:::test
        ChompTest["Chomp Tests"]:::test
        FrogTest["FrogPuzzle Tests"]:::test
        TicTacTest["TicTacToe Tests"]:::test
    end

    subgraph BuildAndCI
        Stack["Stack Build System"]:::build
        CircleCI["CircleCI Integration"]:::ci
    end

    %% Relationships
    Main --> GameRunner
    Main --> GamePlay
    
    Game --> Solver
    SolvableGame --> GamePlay
    
    Solver --> GamePlay
    GamePlay --> GameRunner

    Chomp -.-> Game
    FrogPuzzle -.-> Game
    TicTacToe -.-> Game
    TwentyOne -.-> Game

    Chomp -.-> SolvableGame
    FrogPuzzle -.-> SolvableGame
    TicTacToe -.-> SolvableGame
    TwentyOne -.-> SolvableGame

    ChompTest --> Chomp
    FrogTest --> FrogPuzzle
    TicTacTest --> TicTacToe
    
    MainTest --> ChompTest
    MainTest --> FrogTest
    MainTest --> TicTacTest

    Stack --> Main
    CircleCI --> Stack

    %% Click Events
    click Main "https://github.com/megatron10/Solve-you-a-game/blob/master/app/Main.hs"
    click Solver "https://github.com/megatron10/Solve-you-a-game/blob/master/src/Solver.hs"
    click GamePlay "https://github.com/megatron10/Solve-you-a-game/blob/master/src/GamePlay.hs"
    click GameRunner "https://github.com/megatron10/Solve-you-a-game/blob/master/src/RunGame.hs"
    click Chomp "https://github.com/megatron10/Solve-you-a-game/blob/master/Games/Chomp.hs"
    click FrogPuzzle "https://github.com/megatron10/Solve-you-a-game/blob/master/Games/FrogPuzzle.hs"
    click TicTacToe "https://github.com/megatron10/Solve-you-a-game/blob/master/Games/TicTacToe.hs"
    click TwentyOne "https://github.com/megatron10/Solve-you-a-game/blob/master/Games/TwentyOne.hs"
    click ChompTest "https://github.com/megatron10/Solve-you-a-game/blob/master/test/CHOMPtest.hs"
    click FrogTest "https://github.com/megatron10/Solve-you-a-game/blob/master/test/FPtest.hs"
    click TicTacTest "https://github.com/megatron10/Solve-you-a-game/blob/master/test/TTTtest.hs"
    click MainTest "https://github.com/megatron10/Solve-you-a-game/blob/master/test/Main-test.hs"
    click CircleCI "https://github.com/megatron10/Solve-you-a-game/blob/master/.circleci/config.yml"

    %% Styles
    classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px;
    classDef interface fill:#ffd700,stroke:#333,stroke-width:2px;
    classDef game fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef test fill:#d3d3d3,stroke:#333,stroke-width:2px;
    classDef entry fill:#ff9999,stroke:#333,stroke-width:2px;
    classDef build fill:#DEB887,stroke:#333,stroke-width:2px;
    classDef ci fill:#DEB887,stroke:#333,stroke-width:2px;

    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Interface/Type Class"]:::interface
        L3["Game Implementation"]:::game
        L4["Test Component"]:::test
        L5["Entry Point"]:::entry
        L6["Build/CI"]:::build
    end
```
