Adds a new segment to the snake.
(self, 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. """ |
| 27 | new_segment = Turtle(shape="square") |
| 28 | new_segment.penup() |
| 29 | new_segment.goto(position) |
| 30 | new_segment.color(colors.BODY_COLOR) |
| 31 | self.segments.append(new_segment) |
| 32 | |
| 33 | def extend(self): |
| 34 | """ Adds a new segment to the snake's tail. """ |
no test coverage detected