Initialization

This commit is contained in:
Kozar 2024-04-11 14:18:00 +02:00
parent 9bb83fabba
commit 01ea5cc510

View File

@ -10,10 +10,11 @@ struct snake* add_snake(struct snake* snake,int x,int y){
}
struct snake* remove_snake(struct snake* snake) {
struct snake* temp = snake;
if (snake!= NULL) {
snake = snake->next;
free(temp);
struct snake* head;
struct snake* this = head;
while (this->next != NULL){
this = this->next;
free(this);
}
return snake;
}