Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Visualize-a-tree/Zkl/visualize-a-tree.zkl
Normal file
20
Task/Visualize-a-tree/Zkl/visualize-a-tree.zkl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
fcn vaultDir(out=Console){
|
||||
const INDENT=" ";
|
||||
space:=""; lastPath:=L();
|
||||
foreach fullname in (TheVault.BaseClass.contents.sort()){
|
||||
path:=fullname.split("."); name:=path.pop();
|
||||
if(lastPath==path) out.writeln(space,name);
|
||||
else{
|
||||
n:=0; p:=path.copy();
|
||||
try{
|
||||
while(path[0]==lastPath[0])
|
||||
{ n+=1; path.pop(0); lastPath.pop(0); }
|
||||
}catch{}
|
||||
space=INDENT*n;
|
||||
foreach dir in (path){ out.writeln(space,dir); space+=INDENT; }
|
||||
out.writeln(space,name);
|
||||
lastPath=p;
|
||||
}
|
||||
}
|
||||
"" // so startup has something to display
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue