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

Method create_snake

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

Creates the initial snake body.

(self)

Source from the content-addressed store, hash-verified

17 self.head = self.segments[0]
18
19 def create_snake(self):
20 """ Creates the initial snake body. """
21 for position in STARTING_POSITIONS:
22 self.add_segment(position)
23 self.segments[0].color(colors.FIRST_SEGMENT_COLOR)
24
25 def add_segment(self, position):
26 """ Adds a new segment to the snake. """

Callers 2

__init__Method · 0.95
resetMethod · 0.95

Calls 2

add_segmentMethod · 0.95
colorMethod · 0.80

Tested by

no test coverage detected