summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--day-8/graph.dot12
-rw-r--r--day-8/out.pngbin3822923 -> 3848923 bytes
-rw-r--r--day-8/script.ts6
3 files changed, 18 insertions, 0 deletions
diff --git a/day-8/graph.dot b/day-8/graph.dot
index 272bd5c..7435bc8 100644
--- a/day-8/graph.dot
+++ b/day-8/graph.dot
@@ -1,4 +1,16 @@
digraph aoc {
+ AAA [color=green];
+ MGA [color=green];
+ DGA [color=green];
+ TLA [color=green];
+ RDA [color=green];
+ DPA [color=green];
+ CTZ [color=red];
+ RXZ [color=red];
+ SLZ [color=red];
+ ZZZ [color=red];
+ BSZ [color=red];
+ KKZ [color=red];
LFM -> PCJ;
LFM -> GQH;
THP -> SPP;
diff --git a/day-8/out.png b/day-8/out.png
index 3bc8c0a..acf0b92 100644
--- a/day-8/out.png
+++ b/day-8/out.png
Binary files differ
diff --git a/day-8/script.ts b/day-8/script.ts
index a9870c1..d2869b9 100644
--- a/day-8/script.ts
+++ b/day-8/script.ts
@@ -60,6 +60,12 @@ console.log({ result });
// $ neato graph.dot -Tpng -o out.png
const dotFile = "graph.dot";
fs.writeFileSync(dotFile, "digraph aoc {\n");
+startingNodes.forEach((node) => {
+ fs.appendFileSync(dotFile, ` ${nodes[node].name} [color=green];\n`);
+});
+terminalNodes.forEach((node) => {
+ fs.appendFileSync(dotFile, ` ${nodes[node].name} [color=red];\n`);
+});
nodes.forEach((node) => {
fs.appendFileSync(dotFile, ` ${node.name} -> ${nodes[node.left].name};\n`);
fs.appendFileSync(dotFile, ` ${node.name} -> ${nodes[node.right].name};\n`);