28 lines
294 B
C
28 lines
294 B
C
#ifndef SNAKE_H
|
|
#define SNAKE_H
|
|
|
|
#define SNAKE_SIZE 4
|
|
|
|
typedef struct
|
|
{
|
|
int x;
|
|
int y;
|
|
} Coord;
|
|
|
|
typedef enum
|
|
{
|
|
TOP,
|
|
BOTTOM,
|
|
LEFT,
|
|
RIGHT
|
|
} Direction;
|
|
|
|
typedef struct
|
|
{
|
|
Coord pos[SNAKE_SIZE];
|
|
Direction dir;
|
|
} Snake;
|
|
|
|
void crawl(Snake *snake);
|
|
|
|
#endif /* SNAKE_H */ |