diff --git a/cv9/snake.c b/cv9/snake.c index a897483..1b1717a 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -30,6 +30,12 @@ void free_snake(struct snake* sn) { } int is_snake(struct snake* snake,int x,int y){ + while (snake != NULL) { + if (snake->x == x && snake->y == y) { + return 1; + } + snake = snake->next; + } return 0; }