-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
34 lines (31 loc) · 1.22 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fvonsovs <fvonsovs@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/17 17:34:23 by fvonsovs #+# #+# */
/* Updated: 2023/04/19 16:55:00 by fvonsovs ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int main(int argc, char **argv)
{
t_stack *stack_a;
t_stack *stack_b;
if (argc < 2)
return (0);
else
{
check_input(argv);
stack_a = NULL;
stack_b = NULL;
initialize_list(&stack_a, argv);
if (!is_sorted(stack_a))
push_swap(&stack_a, &stack_b, argc);
free_stack(&stack_a);
free_stack(&stack_b);
}
return (0);
}