diff --git a/builds/print.o b/builds/print.o index 5819b1b..f674759 100644 Binary files a/builds/print.o and b/builds/print.o differ diff --git a/builds/push_swap.o b/builds/push_swap.o index 09ad998..dd821ee 100644 Binary files a/builds/push_swap.o and b/builds/push_swap.o differ diff --git a/builds/stop.o b/builds/stop.o index 4088fad..22bffca 100644 Binary files a/builds/stop.o and b/builds/stop.o differ diff --git a/push_swap b/push_swap index eba674a..8fcaa11 100755 Binary files a/push_swap and b/push_swap differ diff --git a/srcs/print.c b/srcs/print.c index 608b4b9..5753cbe 100644 --- a/srcs/print.c +++ b/srcs/print.c @@ -1,31 +1,6 @@ #include "push_swap.h" -void print_test(t_list *lst, char *s) -{ - t_stack **tmpa; - t_stack **tmpb; - t_stack *a; - t_stack *b; - - tmpa = lst->content; - tmpb = lst->next->content; - a = *tmpa; - b = *tmpb; - ft_printf("%s -> a: %12i . %12i . ", s, tmpa, a); - if (a) - ft_printf("%12i", a->n); - else - ft_printf(" NULL"); - ft_printf(" | b: %12i . %12i . ", tmpb, b); - if (b) - ft_printf("%12i \n", b->n); - else - ft_printf(" NULL\n"); - - //ft_printf("%s -> a: %i , %i , %i / b: %i , %i, %i \n", s, tmpa, a, a->n, tmpb, b, b->n); -} - /* ** this function is called at each action (pushes, swapes, rotates) ** pointers to the stacks a and b are stored into two first element of list solution (because both lists a and b are not available from every functions, like sa() doesn't receive b in argument) @@ -48,7 +23,6 @@ void fill_solution(t_list *solution, char *sp) t_stack *b; char *stack; - print_test(solution, "fill_solution (beginning)"); tmp1 = solution->content; tmp2 = solution->next->content; a = *tmp1; @@ -68,9 +42,7 @@ void fill_solution(t_list *solution, char *sp) stack = ft_strjoinfree(stack, ft_itoa(b->n)); b = b->next; } - print_test(solution, "fill_solu. (bfr add_back)"); ft_lstadd_back(&solution, ft_lstnew(stack)); - print_test(solution, "fill_solu. (aft add_back)"); } void print_result(t_list *result, int flag) diff --git a/srcs/push_swap.c b/srcs/push_swap.c index be3fe5f..a06832c 100644 --- a/srcs/push_swap.c +++ b/srcs/push_swap.c @@ -64,9 +64,7 @@ t_list *launch_algo(t_stack *a) b = NULL; solution = ft_lstnew(&a); ft_lstadd_back(&solution, ft_lstnew(&b)); - print_test(solution, "launch_algo "); fill_solution(solution, ft_strdup("start")); - print_test(solution, "launch_algo (after fill) "); hugo_sort(&a, &b, solution); //bubble_sort(&a, &b, solution); return (solution); @@ -90,9 +88,6 @@ int main(int ac, char **av) flag = check_flag(&ac, &av); stack = init_stack(ac, av); result = launch_algo(stack); - print_test(result, "main "); - //sa(&stack, &result); - print_result(result, flag); ps_stop(NULL, result, 0); return(0); diff --git a/srcs/stop.c b/srcs/stop.c index 141d032..6b9105e 100644 --- a/srcs/stop.c +++ b/srcs/stop.c @@ -69,7 +69,6 @@ void ps_stop(t_stack *stack, t_list *lst, int err) (void)b; */ - print_test(lst, "ps_stop "); if (err < 0) return ; else if (err > 0)