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

View File

@ -35,8 +35,22 @@ void free_snake(struct snake* sn){
}
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;
}
}
}
int step_state(struct state* st){
int nx = (st->snake->x + st->sx);