Visualize a tree: Difference between revisions
→{{header|REXX}}: added the rep procedure
(→{{header|Go}}: Yet another solution, this one more like others on the page.) |
Walterpachl (talk | contribs) (→{{header|REXX}}: added the rep procedure) |
||
Line 1,251:
node.father.0=z
node.a.0level=node.father.0level+1
Return
repl: Procedure
/* REXX ***************************************************************
* Replace old by new in s
**********************************************************************/
Parse Arg s,new,old
in=s
Do Until p=0
p=pos(old,s)
If p>0 Then
s=left(s,p-1)||new||substr(s,p+length(old))
End
Return s
</lang>
{{out}}
<pre>R
|