domaca_uloha_7

This commit is contained in:
Tomáš Vasiľ 2022-04-27 19:01:10 +02:00
parent b6741f316c
commit 886dcc0079

View File

@ -52,9 +52,8 @@ int is_snake(struct snake* snake,int x,int y){
if (snake == NULL) return 0; if (snake == NULL) return 0;
do { do {
if (snake->x == x) { if (snake->x == x || snake->y == y) return 1;
if (snake->y == y) return 1; snake = snake->next;
}
} while (snake->next != NULL); } while (snake->next != NULL);