forked from LeGuit/fillit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolve.c
More file actions
52 lines (47 loc) · 1.41 KB
/
Copy pathsolve.c
File metadata and controls
52 lines (47 loc) · 1.41 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* solve.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gwoodwar <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/04 16:08:24 by gwoodwar #+# #+# */
/* Updated: 2015/12/04 17:07:44 by gwoodwar ### ########.fr */
/* */
/* ************************************************************************** */
void solve(t_list **head)
{
t_list *tmp;
tmp = *head
while (tmp)
{
get_size_piece(CONTENT(head));
tmp = tmp->next;
}
}
static void get_size_piece(t_tetri *tetri)
{
int i;
i = -1;
while ((tetri->piece)[++i])
{
if (isalpha((tetri->piece)[i]))
{
tetri.xmin = i % 5;
tetri.ymin = i / 5;
break ;
}
}
i = 21
while ((tetri->piece)[--i])
{
if (isalpha((tetri->piece)[i]))
{
tetri.width = i % 5;
tetri.height = i / 5;
break ;
}
}
tetri.width -= (tetri.x - 1);
tetri.height -= (tetri.y - 1);
}