domaca_uloha_7

This commit is contained in:
Tomáš Vasiľ 2022-04-27 18:55:57 +02:00
parent 199ef7191c
commit 22fd9ec0ae

View File

@ -49,6 +49,8 @@ void free_snake(struct snake* sn){ //funkcia odstráni hada z hry
} }
int is_snake(struct snake* snake,int x,int y){ int is_snake(struct snake* snake,int x,int y){
if (snake == NULL) return 0;
do { do {
if (snake->x == x || snake->y == y) return 1; if (snake->x == x || snake->y == y) return 1;
} while (snake->next != NULL); } while (snake->next != NULL);