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)
{
next.ID.Walk = N.ID.Walk;
//console.log("processing", next.Meta)
let results = inIterator(next);
if(results !== false)
{

View File

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

View File

@ -8,6 +8,7 @@
<body>
<script>
var count = 0;
let root = N.Create("root");
let recurse = (node, depth) =>
{
@ -18,7 +19,7 @@
N.Connect(node, c2, "parent");
var iterator;
if(depth < 3)
if(depth < 2)
{
// loop over the new nodes and keep recursing
@ -30,14 +31,25 @@
else
{
// 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);
</script>