# mrmaker53/batch-calculator architecture

> Architecture diagram of the GitHub repository mrmaker53/batch-calculator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrmaker53/batch-calculator
- Repository: https://github.com/mrmaker53/batch-calculator

## Overview

Batch-Calculator is a single-file interactive terminal calculator. The user supplies a count and comma-separated integers, then chooses one of eleven operations (or exits); the script validates the count, dispatches the selection, and prints the result. All calculation routines and the terminal menu live in main.py, with no separate storage or service layer. The README and sampled source show no other product subsystems.

Main entry points: [`main.py`](https://github.com/mrmaker53/batch-calculator/blob/main/main.py) (Operation Dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and Interface"]
  node_prompt["Input Prompts<br/>[main.py]"]
  node_menu["Terminal Menu<br/>[main.py]"]
  node_output["Printed Results<br/>[main.py]"]
end

subgraph group_operations["Calculation Operations"]
  node_basic["Basic Arithmetic<br/>[main.py]"]
  node_normalized["Powers and Roots<br/>[main.py]"]
  node_advanced["Factorial and Modulus<br/>[main.py]"]
end

subgraph group_control["Validation and Dispatch"]
  node_validate["Count Validation<br/>[main.py]"]
  node_dispatch["Operation Dispatch<br/>[main.py]"]
end

node_user(("User"))

node_user -->|"enters values"| node_prompt
node_prompt -->|"provides inputs"| node_validate
node_validate -->|"shows when valid"| node_menu
node_validate -->|"prints error"| node_output
node_user -->|"selects operation"| node_menu
node_menu -->|"passes choice"| node_dispatch
node_dispatch -->|"calls"| node_basic
node_dispatch -->|"calls"| node_normalized
node_dispatch -->|"calls"| node_advanced
node_basic -->|"prints result"| node_output
node_normalized -->|"prints result"| node_output
node_advanced -->|"prints result"| node_output

click node_prompt "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_menu "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_validate "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_dispatch "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_basic "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_normalized "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_advanced "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"
click node_output "https://github.com/mrmaker53/batch-calculator/blob/main/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_prompt,node_menu,node_output,node_user toneBlue
class node_basic,node_normalized,node_advanced toneAmber
class node_validate,node_dispatch toneMint
```

## Components

### Input and Interface

- [Input Prompts](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`
- [Terminal Menu](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`
- [Printed Results](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`

### Calculation Operations

- [Basic Arithmetic](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`
- [Powers and Roots](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`
- [Factorial and Modulus](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`

### Validation and Dispatch

- [Count Validation](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`
- [Operation Dispatch](https://github.com/mrmaker53/batch-calculator/blob/main/main.py): `main.py`

### Other components

- **User**

## Connections

- User → Input Prompts: enters values (evidence: `main.py`)
- Input Prompts → Count Validation: provides inputs (evidence: `main.py`)
- Count Validation → Terminal Menu: shows when valid (evidence: `main.py`)
- Count Validation → Printed Results: prints error (evidence: `main.py`)
- User → Terminal Menu: selects operation (evidence: `main.py`)
- Terminal Menu → Operation Dispatch: passes choice (evidence: `main.py`)
- Operation Dispatch → Basic Arithmetic: calls (evidence: `main.py`)
- Operation Dispatch → Powers and Roots: calls (evidence: `main.py`)
- Operation Dispatch → Factorial and Modulus: calls (evidence: `main.py`)
- Basic Arithmetic → Printed Results: prints result (evidence: `main.py`)
- Powers and Roots → Printed Results: prints result (evidence: `main.py`)
- Factorial and Modulus → Printed Results: prints result (evidence: `main.py`)
