-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
32 lines (30 loc) · 706 Bytes
/
Copy pathmain.c
File metadata and controls
32 lines (30 loc) · 706 Bytes
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
/*
** EPITECH PROJECT, 2024
** B-CPE-110-LYN-1-1-settingup-pierre.riss
** File description:
** main.c
*/
#include "include/my.h"
#include "include/struct.h"
#include "include/other_libs.h"
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
int max_height = 0;
int width = 0;
char *map;
if (argc <= 1 || argc > 3){
my_puterror("Invalide number of arguments\n");
exit(84);
}
if (argc == 2){
map = read_file(argv[1], &max_height, &width);
}
if (argc == 3){
map = generate_map(argv[2], argv[1]);
max_height = str_to_int(argv[1]);
width = str_to_int(argv[1]);
}
traitement(max_height, width, map);
}