skuska
This commit is contained in:
parent
f8ad054518
commit
af6540d032
@ -13,13 +13,16 @@ struct snake* add_snake(struct snake* snake,int x,int y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct snake* remove_snake(struct snake* snake){
|
struct snake* remove_snake(struct snake* snake){
|
||||||
if (snake == NULL) {
|
if (snake == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct snake* nova_hlavicka = snake->next;
|
struct snake* nova_hlavicka = snake->next;
|
||||||
|
|
||||||
free(snake);
|
free(snake);
|
||||||
|
|
||||||
|
assert(nova_hlavicka == NULL || nova_hlavicka->next == NULL);
|
||||||
|
|
||||||
return nova_hlavicka;
|
return nova_hlavicka;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user