MCPcopy Index your code
hub / github.com/geekcomputers/Python / extend

Method extend

Snake Game Using Turtle/snake.py:33–36  ·  view source on GitHub ↗

Adds a new segment to the snake's tail.

(self)

Source from the content-addressed store, hash-verified

31 self.segments.append(new_segment)
32
33 def extend(self):
34 """ Adds a new segment to the snake's tail. """
35 self.add_segment(self.segments[-1].position())
36 self.segments[0].color(colors.FIRST_SEGMENT_COLOR)
37
38 def move(self):
39 """ Moves the snake forward by moving each segment to the position of the one in front."""

Callers 9

mainFunction · 0.80
Luhn_Algorithm.pyFile · 0.80
__init__Method · 0.80
load_rectanglesFunction · 0.80
get_phone_numberMethod · 0.80
mainFunction · 0.80
game_loopFunction · 0.80
build_application_indexFunction · 0.80
recognize_audioFunction · 0.80

Calls 2

add_segmentMethod · 0.95
colorMethod · 0.80

Tested by

no test coverage detected