refresh
This commit is contained in:
parent
8e5e2a2dae
commit
44fa14ab8a
14
du5/snake.c
14
du5/snake.c
@ -38,6 +38,20 @@ struct snake* remove_snake(struct snake* snake) {
|
|||||||
free(previous->next);
|
free(previous->next);
|
||||||
previous->next = NULL;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user