hlavicka
This commit is contained in:
parent
c9772bea75
commit
710956e0df
10
cv9/snake.c
10
cv9/snake.c
@ -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){
|
||||||
|
struct snake* hlavicka = (struct snake*)malloc(sizeof(struct snake));
|
||||||
|
if (hlavicka == NULL) {
|
||||||
return 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){
|
||||||
|
Loading…
Reference in New Issue
Block a user