-
Notifications
You must be signed in to change notification settings - Fork 0
/
push_swap.c
37 lines (34 loc) · 1.32 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: joalmeid <joalmeid@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/23 00:33:40 by joalmeid #+# #+# */
/* Updated: 2023/03/09 12:07:44 by joalmeid ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int main(int argc, char **argv)
{
char **trimmed_argv;
t_list *stack_a;
t_list *stack_b;
stack_a = NULL;
stack_b = NULL;
if (argc > 1)
{
trimmed_argv = remove_space_argv(argv);
if (!validate_args(trimmed_argv))
ft_putstr_fd("Error\n", 2);
else
{
create_stack_a(&stack_a, trimmed_argv);
push_swap(&stack_a, &stack_b);
}
free_trimmed_argv(trimmed_argv);
}
free_stacks(&stack_a, &stack_b);
return (0);
}