Jump to content

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.)
(→‎{{header|REXX}}: added the rep procedure)
Line 1,251:
node.father.0=z
node.a.0level=node.father.0level+1
Return</lang>
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
2,300

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.