-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
44 lines (40 loc) · 1.47 KB
/
main.c
File metadata and controls
44 lines (40 loc) · 1.47 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* main.c :+: :+: */
/* +:+ */
/* By: lvan-vlo <lvan-vlo@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2019/08/09 17:08:34 by lvan-vlo #+# #+# */
/* Updated: 2019/09/20 12:50:22 by lvan-vlo ######## odam.nl */
/* */
/* ************************************************************************** */
#include "lem_in.h"
static void set_all_to_null(t_table *lem)
{
lem->ant_table = NULL;
lem->start = NULL;
lem->end = NULL;
lem->hash_table = NULL;
lem->link_table = NULL;
lem->paths = NULL;
lem->rp = NULL;
lem->storage = NULL;
lem->ants = 0;
}
int main(void)
{
t_table *lem;
lem = (t_table *)malloc(sizeof(t_table));
set_all_to_null(lem);
store_input(lem);
make_tables(lem);
lem->start_index = link_index(lem, lem->start);
lem->end_index = link_index(lem, lem->end);
path_traversal(lem);
make_real_paths(lem);
print_storage(lem);
move_ants(lem);
free_everything(lem);
return (0);
}