-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_tetr.c
42 lines (39 loc) · 1.22 KB
/
ft_tetr.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tetr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ohachim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/22 15:55:16 by ohachim #+# #+# */
/* Updated: 2018/11/25 15:03:43 by magoumi ### ########.fr */
/* */
/* ************************************************************************** */
#include "header.h"
t_tet ft_tetr(t_tet tets, char *t, int i)
{
int x;
int s;
char **teto;
int y;
s = 0;
x = 0;
tets.l = i + 65;
teto = ft_strsplit(t, '\n');
while (x < 4)
{
y = 0;
while (y < 4)
{
if (teto[x][y] == '#')
{
tets.coor[s][0] = x;
tets.coor[s][1] = y;
s++;
}
y++;
}
x++;
}
return (tets);
}