-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
32 lines (29 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mrhyhorn <mrhyhorn@student.21-school.ru +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/28 14:16:45 by mrhyhorn #+# #+# */
/* Updated: 2022/04/05 16:16:25 by mrhyhorn ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
int main(int argc, char **argv)
{
t_data data;
if (argc < 2)
ft_puterror("Too few arguments. Try this: ./so_long [map.ber]\n");
else if (argc > 2)
ft_puterror("Too many arguments. Try this: ./so_long [map.ber]\n");
ft_bzero(&data, sizeof(t_data));
data.game = malloc(sizeof(t_game));
if (data.game == NULL)
ft_puterror("Error\nMemory malloc");
ft_init_game(data.game);
ft_read_map(&data, argv[1]);
ft_mlx(&data);
ft_exit(&data);
return (0);
}