Rendu tp3

This commit is contained in:
2025-05-14 14:15:45 +02:00
parent a9ed5e2e01
commit cb05d9710b
6 changed files with 179 additions and 37 deletions

13
grid.h
View File

@@ -2,18 +2,23 @@
#define GRID_H
#include <MLV/MLV_all.h>
#include "snake.h"
#define NBL 22
#define NBC 36
typedef enum {
typedef enum
{
WALL = 'w',
EMPTY = ' ',
FRUIT = 'f'
FRUIT = 'f',
SNAKE = 's'
} Element;
void debug(char grid[NBL][NBC+1]);
void debug(char grid[NBL][NBC + 1]);
int compute_size(int w, int h);
void draw_grid(char grid[NBL][NBC+1]);
void draw_grid(char grid[NBL][NBC + 1]);
void place_snake(char grid[NBL][NBC + 1], Snake *snake);
void move_snake(Snake* snake, char grid[NBL][NBC+1]);
#endif /* GRID_H */