Fractal tree: Difference between revisions

Content deleted Content added
Sonia (talk | contribs)
Go solution
Line 866: Line 866:
def drawTree(x1, y1, angle, depth)
def drawTree(x1, y1, angle, depth)
if !(depth == 0)
if depth != 0
x2 = x1 + (Math.cos(angle * @deg_to_rad) * depth * 10.0).to_i
x2 = x1 + (Math.cos(angle * @deg_to_rad) * depth * 10.0).to_i
y2 = y1 + (Math.sin(angle * @deg_to_rad) * depth * 10.0).to_i
y2 = y1 + (Math.sin(angle * @deg_to_rad) * depth * 10.0).to_i
Line 880: Line 880:
end
end
</lang>
</lang>

=={{header|Scala}}==
=={{header|Scala}}==
Adapted from the Java version. Screenshot below.
Adapted from the Java version. Screenshot below.