-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapa.h
More file actions
42 lines (31 loc) · 851 Bytes
/
mapa.h
File metadata and controls
42 lines (31 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _MAPA_H_
#define _MAPA_H_
#define EMPTY '.'
#define GHOST 'F'
#define PERSON '@'
#define PILULA 'P'
#define WALL_VERTICAL '|'
#define WALL_HORIZONTAL '-'
struct mapa {
char** matriz;
int linhas;
int colunas;
};
typedef struct mapa MAPA;
void alocaMapa(MAPA* m);
void lerMapa(MAPA* m);
void liberaMapa(MAPA* m);
struct posicao {
int x;
int y;
};
typedef struct posicao POSICAO;
int encontraMapa(MAPA* m, POSICAO* person, char c);
int ehValida(MAPA* m, int x, int y);
int ehParede(MAPA* m, int x, int y);
int ehPilula(MAPA* m, int x, int y);
int ehPerson(MAPA* m, char person, int x, int y);
void moveMapa(MAPA* m, int xorigem, int yorigem, int xdestino, int ydestino);
void copiaMapa(MAPA* destino, MAPA * origem);
int podeAndar(MAPA* m, char person, int x, int y);
#endif