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