From a4f6ef7cd2cd316ec81a1895512f469b4be226f4 Mon Sep 17 00:00:00 2001 From: ak643du Date: Wed, 17 Apr 2024 15:57:26 +0200 Subject: [PATCH] Initialization --- cv9/snake.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; }