Files
snake2025/snake.h
2025-05-19 16:06:59 +02:00

32 lines
369 B
C

#ifndef SNAKE_H
#define SNAKE_H
struct GridStruct;
#define SNAKE_SIZE 4
typedef struct
{
int x;
int y;
} Coord;
typedef enum
{
TOP,
BOTTOM,
LEFT,
RIGHT
} Direction;
struct SnakeStruct
{
Coord pos[SNAKE_SIZE];
Direction dir;
};
typedef struct SnakeStruct Snake;
void crawl(Snake *snake, struct GridStruct *g);
#endif /* SNAKE_H */