# tzadiko/janestreetpuzzles architecture

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

- Interactive diagram: https://gitdiagram.com/tzadiko/janestreetpuzzles
- Repository: https://github.com/tzadiko/janestreetpuzzles

## Overview

JaneStreetPuzzles is a collection of independent programs answering monthly Jane Street puzzles, not a single application. Each solution takes puzzle-specific input or hard-coded parameters, searches, simplifies, or counts candidate configurations, and prints results. The clearest multi-layer workflow is December 2020’s constrained matrix search, supported by matrix and rule modules. Other sampled solutions are standalone puzzle solvers. The README identifies no broader product capabilities; unsampled monthly entries are therefore not assigned speculative runtime behavior.

Main entry points: [`December 2020/MatrixRules.h`](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/MatrixRules.h) (Rule validation), [`December 2020/Matrix.h`](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Matrix.h) (Matrix model), [`December 2020/main.cpp`](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/main.cpp) (Grid search entry), [`December 2020/Grid.h`](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Grid.h) (Grid facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dec["December grid solver"]
  node_decmain["Grid search entry<br/>[main.cpp]"]
  node_grid["Grid facade<br/>[Grid.h]"]
  node_matrix["Matrix model<br/>[Matrix.h]"]
  node_rules["Rule validation<br/>[MatrixRules.h]"]
  node_direction["View directions<br/>[Direction.h]"]
  node_rule["Rule records<br/>[Rule.h]"]
  node_offset["Cell offsets<br/>[Offset.h]"]
end

subgraph group_search["Search and placement puzzles"]
  node_april["Triangle placement<br/>[solution.cpp]"]
  node_oct19["October puzzle solver"]
  node_june["June puzzle solver"]
  node_feb["February puzzle solver<br/>[Solution.cpp]"]
end

subgraph group_count["Combinatorial solutions"]
  node_oct20["Box permutations<br/>[solution.php]"]
  node_jan21["Toy arrangement count<br/>[Program.cs]"]
  node_may["May puzzle solver<br/>[Solution.cpp]"]
end

subgraph group_transform["Sequence transformation"]
  node_sep["Move sequence solver<br/>[main.cpp]"]
end

node_decmain -->|"includes"| node_grid
node_decmain -->|"checks constraints"| node_rules
node_decmain -->|"searches matrices"| node_matrix
node_grid -->|"includes"| node_matrix
node_grid -->|"includes"| node_rules
node_rules -->|"uses matrix"| node_matrix
node_rules -->|"uses views"| node_direction
node_rules -->|"uses records"| node_rule
node_matrix -->|"uses directions"| node_direction
node_matrix -->|"uses offsets"| node_offset

click node_decmain "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/main.cpp"
click node_grid "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Grid.h"
click node_matrix "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Matrix.h"
click node_rules "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/MatrixRules.h"
click node_direction "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Direction.h"
click node_rule "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Rule.h"
click node_offset "https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Offset.h"
click node_april "https://github.com/tzadiko/janestreetpuzzles/blob/master/April%202020/solution.cpp"
click node_oct19 "https://github.com/tzadiko/janestreetpuzzles/blob/master/October%202019/TriTriAgainAgain.cpp"
click node_june "https://github.com/tzadiko/janestreetpuzzles/blob/master/June%202020/June2020Solution.cpp"
click node_feb "https://github.com/tzadiko/janestreetpuzzles/blob/master/February%202020/Solution.cpp"
click node_oct20 "https://github.com/tzadiko/janestreetpuzzles/blob/master/October%202020/solution.php"
click node_jan21 "https://github.com/tzadiko/janestreetpuzzles/blob/master/January%202021/Program.cs"
click node_may "https://github.com/tzadiko/janestreetpuzzles/blob/master/May%202020/Solution.cpp"
click node_sep "https://github.com/tzadiko/janestreetpuzzles/blob/master/September%202020/main.cpp"

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_decmain,node_grid,node_matrix,node_rules,node_direction,node_rule,node_offset toneBlue
class node_april,node_oct19,node_june,node_feb toneAmber
class node_oct20,node_jan21,node_may toneMint
class node_sep toneRose
```

## Components

### December grid solver

- [Grid search entry](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/main.cpp): `December 2020/main.cpp`
- [Grid facade](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Grid.h): `December 2020/Grid.h`
- [Matrix model](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Matrix.h): `December 2020/Matrix.h`
- [Rule validation](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/MatrixRules.h): `December 2020/MatrixRules.h`
- [View directions](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Direction.h): `December 2020/Direction.h`
- [Rule records](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Rule.h): `December 2020/Rule.h`
- [Cell offsets](https://github.com/tzadiko/janestreetpuzzles/blob/master/December%202020/Offset.h): `December 2020/Offset.h`

### Search and placement puzzles

- [Triangle placement](https://github.com/tzadiko/janestreetpuzzles/blob/master/April%202020/solution.cpp): `April 2020/solution.cpp`
- [October puzzle solver](https://github.com/tzadiko/janestreetpuzzles/blob/master/October%202019/TriTriAgainAgain.cpp): `October 2019/TriTriAgainAgain.cpp`
- [June puzzle solver](https://github.com/tzadiko/janestreetpuzzles/blob/master/June%202020/June2020Solution.cpp): `June 2020/June2020Solution.cpp`
- [February puzzle solver](https://github.com/tzadiko/janestreetpuzzles/blob/master/February%202020/Solution.cpp): `February 2020/Solution.cpp`

### Combinatorial solutions

- [Box permutations](https://github.com/tzadiko/janestreetpuzzles/blob/master/October%202020/solution.php): `October 2020/solution.php`
- [Toy arrangement count](https://github.com/tzadiko/janestreetpuzzles/blob/master/January%202021/Program.cs): `January 2021/Program.cs`
- [May puzzle solver](https://github.com/tzadiko/janestreetpuzzles/blob/master/May%202020/Solution.cpp): `May 2020/Solution.cpp`

### Sequence transformation

- [Move sequence solver](https://github.com/tzadiko/janestreetpuzzles/blob/master/September%202020/main.cpp): `September 2020/main.cpp`

## Connections

- Grid search entry → Grid facade: includes (evidence: `December 2020/main.cpp`)
- Grid search entry → Rule validation: checks constraints (evidence: `December 2020/main.cpp`)
- Grid search entry → Matrix model: searches matrices (evidence: `December 2020/main.cpp`)
- Grid facade → Matrix model: includes (evidence: `December 2020/Grid.h`)
- Grid facade → Rule validation: includes (evidence: `December 2020/Grid.h`)
- Rule validation → Matrix model: uses matrix (evidence: `December 2020/MatrixRules.h`)
- Rule validation → View directions: uses views (evidence: `December 2020/MatrixRules.h`)
- Rule validation → Rule records: uses records (evidence: `December 2020/MatrixRules.h`)
- Matrix model → View directions: uses directions (evidence: `December 2020/Matrix.h`)
- Matrix model → Cell offsets: uses offsets (evidence: `December 2020/Matrix.h`)
