summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsnake/snake.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/snake/snake.py b/snake/snake.py
index 98975cb..40bbdcc 100755
--- a/snake/snake.py
+++ b/snake/snake.py
@@ -119,6 +119,7 @@ class Snake:
self.score+=1
pygame.display.flip()
clock.tick(self.fps)
+ return(self.score)
game=Snake()
@@ -128,4 +129,5 @@ def event_handler(game):
game.direction=6
for i in range(0,10):
- game.run() \ No newline at end of file
+ score=game.run()
+ print("Game ended with "+str(score)) \ No newline at end of file