aboutsummaryrefslogtreecommitdiff
path: root/src/push_swap/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/push_swap/main.c')
-rw-r--r--src/push_swap/main.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/push_swap/main.c b/src/push_swap/main.c
index 5019e79..b97feb3 100644
--- a/src/push_swap/main.c
+++ b/src/push_swap/main.c
@@ -1,4 +1,49 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/01/19 09:09:59 by cacharle #+# #+# */
+/* Updated: 2020/01/19 13:37:26 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "push_swap.h"
+
int main(int argc, char **argv)
{
+ t_stack *a;
+ t_stack *b;
+
+ if (argc == 1)
+ return (0);
+ if ((a = stack_new(argc - 1)) == NULL)
+ return (1);
+ if (parse(argc, argv, a) != STATUS_SUCCESS)
+ return (1);
+ if ((b = stack_new(stack_length(a))) == NULL)
+ {
+ stack_destroy(a);
+ return (1);
+ }
+
+ a->tag = STACK_A;
+ b->tag = STACK_B;
+
+ push_swap_qsort(a, b);
+ /* push_swap_qsort(a, b); */
+ /* push_swap_qsort(a, b); */
+ /* push_swap_qsort(a, b); */
+ /* push_swap_qsort(a, b); */
+
+ /* printf("\na: "); */
+ /* stack_print(a); */
+ /* printf("b: "); */
+ /* stack_print(b); */
+
+ stack_destroy(a);
+ stack_destroy(b);
return 0;
}