Initialization
This commit is contained in:
parent
9bb83fabba
commit
01ea5cc510
@ -10,10 +10,11 @@ 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) {
|
||||||
struct snake* temp = snake;
|
struct snake* head;
|
||||||
if (snake!= NULL) {
|
struct snake* this = head;
|
||||||
snake = snake->next;
|
while (this->next != NULL){
|
||||||
free(temp);
|
this = this->next;
|
||||||
|
free(this);
|
||||||
}
|
}
|
||||||
return snake;
|
return snake;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user