-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_place.c
28 lines (26 loc) · 1.29 KB
/
ft_place.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_place.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akerkeb <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/01/21 23:13:42 by akerkeb #+# #+# */
/* Updated: 2016/01/21 23:13:44 by akerkeb ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
void ft_place(t_tetri *mainlist, char **final_carre, int y, int x)
{
mainlist->is_valid = 1;
while (mainlist->p->next != NULL)
{
final_carre[y + mainlist->p->y][x + mainlist->p->x] =
mainlist->tetri_number + 'A';
mainlist->p = mainlist->p->next;
}
final_carre[y + mainlist->p->y][x + mainlist->p->x] =
mainlist->tetri_number + 'A';
while (mainlist->p->prev)
mainlist->p = mainlist->p->prev;
}