MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / draw_cross

Function draw_cross

fractals/vicsek.py:18–34  ·  view source on GitHub ↗

Draw a cross at the specified position and with the specified length.

(x: float, y: float, length: float)

Source from the content-addressed store, hash-verified

16
17
18def draw_cross(x: float, y: float, length: float):
19 """
20 Draw a cross at the specified position and with the specified length.
21 """
22 turtle.up()
23 turtle.goto(x - length / 2, y - length / 6)
24 turtle.down()
25 turtle.seth(0)
26 turtle.begin_fill()
27 for _ in range(4):
28 turtle.fd(length / 3)
29 turtle.right(90)
30 turtle.fd(length / 3)
31 turtle.left(90)
32 turtle.fd(length / 3)
33 turtle.left(90)
34 turtle.end_fill()
35
36
37def draw_fractal_recursive(x: float, y: float, length: float, depth: float):

Callers 1

draw_fractal_recursiveFunction · 0.85

Calls 2

rightMethod · 0.45
leftMethod · 0.45

Tested by

no test coverage detected