Изменить 'du7/snake.c'

This commit is contained in:
Oleksandr Hryshchenko 2021-04-27 17:34:37 +00:00
parent bcf30cd819
commit 0ca453d4ca

View File

@ -84,7 +84,7 @@ int step_state(struct state* st){
} }
} }
for(struct snake* temp = st->snake->next != NULL; temp = temp->next){ for(struct snake* temp = st->snake; temp != NULL; temp = temp->next){
if((nx == temp->x && ny == temp->y) || (nx < 0 || nx >= st->width || ny < 0 || ny >= st->height)){ if((nx == temp->x && ny == temp->y) || (nx < 0 || nx >= st->width || ny < 0 || ny >= st->height)){
return END_SNAKE; return END_SNAKE;
} }