From b6741f316c4140e5a93eff239c0b20051580216b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vasi=C4=BE?= Date: Wed, 27 Apr 2022 18:58:58 +0200 Subject: [PATCH] domaca_uloha_7 --- du7/snake.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;