Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1010241 // web_printTree - walk through web and print a tree

JavaX fragment (include)

static void web_printTree(WebNode node) {
  web_printTree(node, "", "", new HashSet);
  print();
}

static void web_printTree(WebNode node, S indent, S relation, HashSet<WebNode> seen) {
  if (node == null) ret;
  print(indent + relation + node.text());
  if (!seen.add(node)) ret;
  for (WebNode n : web_forwardRelated(node))
    web_printTree(n, indent + "  ", appendIfNempty(web_relationText(node, n), " -> "), seen);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010241
Snippet name: web_printTree - walk through web and print a tree
Eternal ID of this version: #1010241/5
Text MD5: 44fc403b46284e696b5b57bc44e75f26
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-07 18:19:43
Source code size: 433 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 414 / 457
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010246 - web_makeTree - walk through web and make WebTree
#1010247 - web_printWebTree - print WebTree