-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_place.c
34 lines (31 loc) · 1.22 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
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_place.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ohachim <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/23 00:15:35 by ohachim #+# #+# */
/* Updated: 2018/11/25 15:01:24 by magoumi ### ########.fr */
/* */
/* ************************************************************************** */
#include "header.h"
char **ft_place(t_tet tets, char **board, int x, int y)
{
int i;
int j;
int size;
size = ft_strlenc(*board, '$');
i = 0;
j = 1;
board[x][y] = tets.l;
while (i < 4 && j < 4)
{
x = x + (tets.coor[j][0] - tets.coor[i][0]);
y = y + (tets.coor[j][1] - tets.coor[i][1]);
board[x][y] = tets.l;
i++;
j++;
}
return (board);
}