diff --git a/du7/snake.c b/du7/snake.c index bd4d117..b98ffbf 100644 --- a/du7/snake.c +++ b/du7/snake.c @@ -52,9 +52,8 @@ int is_snake(struct snake* snake,int x,int y){ if (snake == NULL) return 0; do { - if (snake->x == x) { - if (snake->y == y) return 1; - } + if (snake->x == x || snake->y == y) return 1; + snake = snake->next; } while (snake->next != NULL);