_Title "3 branching recurs by tsh73 more like original" 'b+ trans from JB 2021-12-03 Const ss
= 600, cx
= ss
/ 2, cy
= cx
, pi
= _Pi Color &HFF000011, &HFFBBBBFF drawBranches cx, cy, 0, 0, 256, 0
Sub drawBranches
(x
, y
, a
, totLen
, leg
, level
) ' This had me stuck for awhile!!!
legth = leg ' <<<< change name of variable for recursive sub in QB64 before passing changed value in next call
x1
= cx
+ Cos(a
) * totLen
y1
= cy
+ Sin(a
) * totLen
N = 3 ^ (level + 1)
da = 2 * pi / N
legth = legth / 2 ' >> changed value requires the name change in QB64 (not in JB that passes by value not reference)
drawBranches x1, y1, (a - da), (totLen + legth), legth, level + 1
drawBranches x1, y1, a, (totLen + legth), legth, level + 1
drawBranches x1, y1, (a + da), (totLen + legth), legth, level + 1