diff --git a/du5/snake.c b/du5/snake.c index b5f4018..95ef638 100644 --- a/du5/snake.c +++ b/du5/snake.c @@ -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; }