-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_debug.c
56 lines (52 loc) · 1.82 KB
/
print_debug.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dstepane <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/16 11:55:04 by dstepane #+# #+# */
/* Updated: 2019/03/16 11:55:05 by dstepane ### ########.fr */
/* */
/* ************************************************************************** */
#include "filler.h"
void print_piece(t_flr *f)
{
usleep(1000);
dprintf(2, ">> PIECE:\n");
for (int i = 0; i < f->fig_h; i++)
dprintf(2, "%s\n", f->fig[i]);
dprintf(2, "__________________\n");
}
void print_map(t_flr *f)
{
dprintf(2, "map ");
int j = 0;
for (int i = 0; i < f->map_w; i++)
{
dprintf(2, "%d", j++);
j == 10 ? j = 0 : 0;
}
dprintf(2, "\n");
for (int i = 0; i < f->map_h; i++)
dprintf(2, "%0.3d: %s\n", i, f->map[i]);
dprintf(2, "=====================================================================\n");
}
void print_heatmap(t_flr *f)
{
dprintf(2, "\n");
dprintf(2, "heat ");
for (int i = 0; i < f->map_w; i++)
dprintf(2, "|%2d ", i);
dprintf(2, "|\n");
int y = 0;
while (y < f->map_h)
{
dprintf(2, "%03d: ", y);
for (int x = 0; x < f->map_w; x++)
dprintf(2, "|%2d ", f->hm[y][x]);
dprintf(2, "|\n");
y++;
}
dprintf(2, "\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
}