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

Method up

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

Turns the snake's head upwards, preventing it from reversing.

(self)

Source from the content-addressed store, hash-verified

52 self.head = self.segments[0]
53
54 def up(self):
55 """Turns the snake's head upwards, preventing it from reversing."""
56 if self.head.heading() != DOWN:
57 self.head.setheading(UP)
58
59 def down(self):
60 """Turns the snake's head downwards, preventing it from reversing."""

Callers 3

triangleFunction · 0.80
forwardMethod · 0.80
handle_snake_upFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected