Изменить 'du7/snake.c'
This commit is contained in:
parent
0ca453d4ca
commit
a2d1f37408
@ -29,6 +29,10 @@ 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->next == NULL){
|
||||
return snake;
|
||||
}
|
||||
|
||||
while(temp->next->next != NULL){
|
||||
temp = temp->next; // проход до последнего кусочка
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user