MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / drawTwistDownSegment

Function drawTwistDownSegment

src/gamesbyexample/pythons.py:112–131  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

110
111
112def drawTwistDownSegment(length):
113 turtle.begin_fill()
114 turtle.forward(GAP + THICKNESS)
115 turtle.right(90)
116 turtle.forward(length - THICKNESS)
117 final_position = turtle.position()
118 turtle.penup()
119 turtle.forward(THICKNESS)
120 turtle.pendown()
121 turtle.right(90)
122 turtle.forward(THICKNESS)
123 turtle.right(90)
124 turtle.forward(length - THICKNESS)
125 turtle.left(90)
126 turtle.forward(GAP)
127 turtle.end_fill()
128 turtle.penup()
129 turtle.goto(final_position)
130 turtle.pendown()
131 turtle.right(180)
132
133def drawSnake(lengths):
134 drawSnakeHead(lengths[0])

Callers 1

drawSnakeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected