-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_grid.c
43 lines (38 loc) · 1.26 KB
/
print_grid.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_grid.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: juazouz <juazouz@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/20 11:33:15 by juazouz #+# #+# */
/* Updated: 2018/11/24 13:13:52 by juazouz ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
static void print_line(t_grid *grid, int y)
{
int i;
t_tetriminos *content;
i = 0;
while (i < grid->size)
{
content = cell_at(grid, i, y);
if (content != NULL)
ft_putchar(content->id + 'A');
else
ft_putchar('.');
i++;
}
ft_putendl("");
}
void print_grid(t_grid *grid)
{
int i;
i = 0;
while (i < grid->size)
{
print_line(grid, i);
i++;
}
}