-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.c
More file actions
73 lines (62 loc) · 1.16 KB
/
Copy pathui.c
File metadata and controls
73 lines (62 loc) · 1.16 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <stdio.h>
#include "mapa.h"
char desenhoparede[4][7] = {
{"......" },
{"......" },
{"......" },
{"......" }
};
char desenhofantasma[4][7] = {
{" .-. " },
{"| OO| " },
{"| | " },
{"'^^^' " }
};
char desenhoheroi[4][7] = {
{" .--. " },
{"/ _.-'" },
{"\\ '-." },
{" '--' " }
};
char desenhopilula[4][7] = {
{" "},
{" .-. "},
{" '-' "},
{" "}
};
char desenhovazio[4][7] = {
{" "},
{" "},
{" "},
{" "}
};
void imprimeparte(char desenho[4][7], int parte) {
printf("%s", desenho[parte]);
}
void imprimemapa(MAPA* m) {
for(int i = 0; i < m->linhas; i++) {
for(int parte = 0; parte < 4; parte++) {
for(int j = 0; j < m->colunas; j++) {
switch(m->matriz[i][j]) {
case FANTASMA:
imprimeparte(desenhofantasma, parte);
break;
case HEROI:
imprimeparte(desenhoheroi, parte);
break;
case PILULA:
imprimeparte(desenhopilula, parte);
break;
case PAREDE_VERTICAL:
case PAREDE_HORIZONTAL:
imprimeparte(desenhoparede, parte);
break;
case VAZIO:
imprimeparte(desenhovazio, parte);
break;
}
}
printf("\n");
}
}
}