This commit is contained in:
Michal Utľák 2024-04-09 16:36:36 +02:00
parent c9772bea75
commit 710956e0df

View File

@ -2,7 +2,17 @@
#include <stdlib.h> #include <stdlib.h>
struct snake* add_snake(struct snake* snake,int x,int y){ struct snake* add_snake(struct snake* snake,int x,int y){
return NULL; struct snake* hlavicka = (struct snake*)malloc(sizeof(struct snake));
if (hlavicka == NULL) {
return NULL;
}
hlavicka->x = x;
hlavicka->y = y;
hlavicka->next = snake;
return hlavicka;
} }
struct snake* remove_snake(struct snake* snake){ struct snake* remove_snake(struct snake* snake){