Skip to content

Latest commit

 

History

History
56 lines (52 loc) · 1.12 KB

README.md

File metadata and controls

56 lines (52 loc) · 1.12 KB

A beautiful C++ tree generator

It can be printed directly on the output console :

              ┌ Epsilon
              ├─── Zeta
      ┌─ Beta ┤
      │       ├──── Eta
      │       │         ┌───── Mu
      │       └── Theta ┤
      │                 └───── Nu
Alpha ┼ Gamma ────── Xi ─ Omicron
      │       ┌─── Iota
      └ Delta ┼── Kappa
              └─ Lambda

You can define relations between nodes in the edges.json file.

{
  "Alpha": {
    "Beta": {
      "Epsilon": {},
      "Zeta": {},
      "Eta": {},
      "Theta": {
        "Mu": {},
        "Nu": {}
      }
    },
    "Gamma": {
      "Xi": {
        "Omicron": {}
      }
    },
    "Delta": {
      "Iota": {},
      "Kappa": {},
      "Lambda": {}
    }
  }
}

You can also use your own tree representation, the Tree class needs only an adjacency table to work:

int main() {
    ...
    Tree(adjacences).show(root);
}

Made by Adrien Jayat.