This commit is contained in:
Oleksandr Vyshniakov 2025-04-08 19:37:15 +02:00
parent 8e5e2a2dae
commit 44fa14ab8a

View File

@ -38,6 +38,20 @@ struct snake* remove_snake(struct snake* snake) {
free(previous->next);
previous->next = NULL;
}
return snake;
}
int is_snake(struct snake* snake, int x, int y) {
struct snake* current = snake;
while () {
if ((current->x==x) && (current->y==y)) {
return 1;
}
current = current->next;
}
return 0;
}