diff --git a/cv9/snake.c b/cv9/snake.c index 7038cdb..98c45c0 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -2,7 +2,17 @@ #include 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){