Оновити 'cv9/snake.c'
This commit is contained in:
parent
129a0ae833
commit
b1389d8c29
12
cv9/snake.c
12
cv9/snake.c
@ -40,11 +40,13 @@ 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)
|
struct snake* this = snake;
|
||||||
return NULL;
|
while(this != NULL){
|
||||||
if(snake->x == x && snake->y == y)
|
if(this->x == x && this->y == y)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
this = this->next;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int step_state(struct state* st){
|
int step_state(struct state* st){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user