This commit is contained in:
Michal Utľák 2024-04-10 20:57:12 +02:00
parent 69eaba6642
commit bab6423fb9

View File

@ -35,7 +35,21 @@ void free_snake(struct snake* sn){
} }
int is_snake(struct snake* snake,int x,int y){ int is_snake(struct snake* snake,int x,int y){
if(snake == NULL){
return NULL;
}
struct snake* pozicia = snake;
while(pozicia != NULL){
if(pozicia->x == x && pozicia->y == y){
return 1;
}
else{
return 0; return 0;
}
}
} }
int step_state(struct state* st){ int step_state(struct state* st){