-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_swap.c
39 lines (36 loc) · 1.25 KB
/
push_swap.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: enoye <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/22 15:12:43 by enoye #+# #+# */
/* Updated: 2021/11/22 15:12:55 by enoye ### ########.fr */
/* */
/* ************************************************************************** */
#include "libpushswap.h"
int main(int argc, char **argv)
{
t_list *a;
t_list *b;
t_need nd;
t_flags var;
a = 0;
b = 0;
nd.edge = 0;
var.sa = 0;
if (argc == 1)
return (0);
a = full_stack_a(a, argv);
if (a == 0 || is_it_sorted(&a) == 1)
return (0);
nd.sort = sort_list(&a);
if (nd.sort == 0)
{
ft_lstclear(&a);
return (0);
}
go_go_go(a, b, var, nd);
return (0);
}