Оновити 'cv9/snake.c'
This commit is contained in:
parent
62a409e3c3
commit
7a78071984
@ -2,13 +2,14 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
struct snake* add_snake(struct snake* snake,int x,int y){
|
||||
if (snake == NULL) {
|
||||
struct snake* head = calloc(1,sizeof(struct snake));
|
||||
if (head == NULL) {
|
||||
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){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user