From 4647dcd2665761735d8c5bafbeb087e1ea95bc7e Mon Sep 17 00:00:00 2001 From: Pragati Pal <71111053+pragatipal@users.noreply.github.com> Date: Sat, 2 Oct 2021 01:12:47 +0530 Subject: [PATCH] Snake Game.py --- .../Python_Programs/Snake game.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Program's_Contributed_By_Contributors/Python_Programs/Snake game.py diff --git a/Program's_Contributed_By_Contributors/Python_Programs/Snake game.py b/Program's_Contributed_By_Contributors/Python_Programs/Snake game.py new file mode 100644 index 0000000000..471bb11913 --- /dev/null +++ b/Program's_Contributed_By_Contributors/Python_Programs/Snake game.py @@ -0,0 +1,57 @@ +#snake game +from turtle import * +from random import randrange +from freegames import square,vector + +food = vector(0,0) +snake=[vector(10,0)] +aim=vector(0,-10) + +def change(x,y): + aim.x= x + aim.y =y + +def inside(head): + "Return True if head inside boundaries" + return -200