Оновити 'cv9/snake.c'
This commit is contained in:
parent
f01135edba
commit
195a252054
@ -2,10 +2,10 @@
|
|||||||
#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){
|
||||||
struct snake* head = calloc(1,sizeof(struct snake));
|
if (snake == NULL) {
|
||||||
if (head == NULL) {
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
struct snake* head = calloc(1,sizeof(struct snake));
|
||||||
head->x = x;
|
head->x = x;
|
||||||
head->y = y;
|
head->y = y;
|
||||||
head->next = snake;
|
head->next = snake;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user