From 6343d2b6ab6aa63a1fb60859b7efdae77190efe0 Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 11 Apr 2024 14:03:01 +0200 Subject: [PATCH] Initialization --- cv9/snake.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cv9/snake.c b/cv9/snake.c index 7038cdb..daf1c61 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -2,7 +2,11 @@ #include struct snake* add_snake(struct snake* snake,int x,int y){ - return NULL; + struct snake* head = calloc(1,sizeof(struct snake)); + head->x = x; + head->y = y; + head->next = snake; + return head; } struct snake* remove_snake(struct snake* snake){