-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
41 lines (38 loc) · 1.34 KB
/
main.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amersoul <amersoul@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/25 10:46:27 by amersoul #+# #+# */
/* Updated: 2018/10/31 10:02:31 by amersoul ### ########.fr */
/* */
/* ************************************************************************** */
#include "tetriminos/tetriminos.h"
int main(int argc, char **argv)
{
int fd;
t_tetros *tetros;
if (argc == 2)
{
fd = open(argv[1], O_RDONLY);
if (fd == -1)
{
ft_putstr("error\n");
return (-1);
}
tetros = ft_read_tetros(fd);
if (!tetros)
{
ft_putstr("error\n");
return (-1);
}
ft_reverse_tetros(&tetros);
ft_move_tetros_ftl(&tetros);
ft_solve_fillit(tetros);
return (0);
}
ft_putstr("Usage : ./fillit <filename>\n");
return (-1);
}