articulate problem

This commit is contained in:
TreetopFlyer 2021-05-29 11:58:03 -04:00
parent 03ddaa8442
commit 0032f41b01
3 changed files with 16 additions and 13 deletions

1
N.js
View File

@ -143,7 +143,6 @@ var N =
if(next.ID.Walk !== N.ID.Walk) if(next.ID.Walk !== N.ID.Walk)
{ {
next.ID.Walk = N.ID.Walk; next.ID.Walk = N.ID.Walk;
//console.log("processing", next.Meta)
let results = inIterator(next); let results = inIterator(next);
if(results !== false) if(results !== false)
{ {

View File

@ -105,14 +105,6 @@ var Pivot =
console.log("walking modifiers up from", inLastBranch.Meta.Label); console.log("walking modifiers up from", inLastBranch.Meta.Label);
N.ID.Walk++; N.ID.Walk++;
N.Walk(connectModifiers, inLastBranch, "Hierarchy", false); N.Walk(connectModifiers, inLastBranch, "Hierarchy", false);
/*
N.Walk((n)=>
{
console.log("going up", n);
}
, inLastBranch, "Hierarchy", false);
*/
} }
// lastly connect the leaf to the branch // lastly connect the leaf to the branch

View File

@ -8,6 +8,7 @@
<body> <body>
<script> <script>
var count = 0;
let root = N.Create("root"); let root = N.Create("root");
let recurse = (node, depth) => let recurse = (node, depth) =>
{ {
@ -18,7 +19,7 @@
N.Connect(node, c2, "parent"); N.Connect(node, c2, "parent");
var iterator; var iterator;
if(depth < 3) if(depth < 2)
{ {
// loop over the new nodes and keep recursing // loop over the new nodes and keep recursing
@ -30,14 +31,25 @@
else else
{ {
// walk up // walk up
iterator = () => iterator = (child) =>
{ {
/*
issue: why does incrementing walk id cause an infinite loop
*/
N.ID.Walk++;
count++;
if(count > 100)
{
console.log("big problems");
throw new Error("holy crap");
}
}; };
} }
N.Walk(iterator, node, "parent", true);
N.Walk(iterator, node, "parent");
} }
N.ID.Walk++;
recurse(root, 0); recurse(root, 0);
</script> </script>