diff --git a/cv9/snake.c b/cv9/snake.c index 985cc10..a0cf258 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -35,7 +35,21 @@ void free_snake(struct snake* sn){ } int is_snake(struct snake* snake,int x,int y){ - return 0; + if(snake == NULL){ + return NULL; + } + + struct snake* pozicia = snake; + + while(pozicia != NULL){ + if(pozicia->x == x && pozicia->y == y){ + return 1; + } + else{ + return 0; + } + } + } int step_state(struct state* st){