0

Why is this my program not working? That is in my discription

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 changes(x,y): aim.x = x aim.y = y def inside(head): return-200<head.x<190 and -200 <head.y <190 def move(): head = snake [-1].copy() head.move(aim) if not inside(head) or head in snake: square(head.x,body.y,9,'green') square(food.x,body.y,9,'red') update() ontimer(move, 100) hideturtle() tracer(false) listen() onkey(lambda:changes(10,0),'Right') onkey(lambda:changes(-10,0),'Left') onkey(lambda:changes(0,10),'Up') onkey(lambda:changes(0,-10),'Down') move() done()

16th Feb 2021, 1:22 AM
ashutosh abhimanyu
ashutosh abhimanyu - avatar
5 odpowiedzi
0
please use code playground to share code. also, for future reference, tags for this would be: turtle, python, tkinter, error meanwhile, i will try the code and see what i get, as i am only semi-familiar with turtle. bon voyage... edit: what is freegames?
16th Feb 2021, 5:57 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
Thanks! But I think you dont know more about freegame, python, turtle etc.
24th Feb 2021, 12:44 PM
ashutosh abhimanyu
ashutosh abhimanyu - avatar
0
i am unfamiliar with freegame, and know fairly less about turtle than some, but i know basic python very well. if you can tell me where you got the freegame module i will try it out (i am used to livewires modified)
24th Feb 2021, 1:57 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
this is the module "freegames" that works in your laptop or any pc easily. No mention bro, You're very well! Nice to meet you
24th Feb 2021, 2:36 PM
ashutosh abhimanyu
ashutosh abhimanyu - avatar
0
where did you get it? is it in the pip repository?
24th Feb 2021, 2:50 PM
Wilbur Jaywright
Wilbur Jaywright - avatar