domaca_uloha_7
This commit is contained in:
parent
2e2720ce15
commit
90b8a98abd
@ -2,12 +2,13 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
struct snake* add_snake(struct snake* snake,int x,int y){
|
struct snake* add_snake(struct snake* snake,int x,int y){
|
||||||
if (snake == NULL) return NULL;
|
|
||||||
|
|
||||||
struct snake* novyZaciatok;
|
struct snake* novyZaciatok;
|
||||||
novyZaciatok->x = x;
|
novyZaciatok->x = x;
|
||||||
novyZaciatok->y = y;
|
novyZaciatok->y = y;
|
||||||
|
|
||||||
|
if (snake != NULL) {
|
||||||
snake->next = novyZaciatok;
|
snake->next = novyZaciatok;
|
||||||
|
}
|
||||||
|
|
||||||
return novyZaciatok;
|
return novyZaciatok;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user