23 lines
419 B
C
23 lines
419 B
C
#ifndef GRID_H
|
|
#define GRID_H
|
|
|
|
#include "snake.h"
|
|
|
|
#define NBL 22
|
|
#define NBC 36
|
|
|
|
typedef enum
|
|
{
|
|
WALL = 'w',
|
|
EMPTY = ' ',
|
|
FRUIT = 'f',
|
|
SNAKE = 's'
|
|
} Element;
|
|
|
|
void debug(char grid[NBL][NBC + 1]);
|
|
int compute_size(int w, int h);
|
|
void draw_grid(char grid[NBL][NBC + 1]);
|
|
void place_snake(char grid[NBL][NBC + 1], Snake *snake);
|
|
Element move_snake(Snake* snake, char grid[NBL][NBC+1]);
|
|
|
|
#endif /* GRID_H */ |