debugage de dup stack a
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
|
||||
#include "push_swap.h"
|
||||
|
||||
/*
|
||||
** this function check errors in the arguments
|
||||
** like, is there arguments, and are they a valid list without equals values
|
||||
** if there are no arguments it calls the stop function with value 1 to print usage
|
||||
*/
|
||||
void is_valid(int ac, char **av)
|
||||
{
|
||||
if (ac < 2)
|
||||
@@ -14,10 +9,6 @@ void is_valid(int ac, char **av)
|
||||
// check more error
|
||||
}
|
||||
|
||||
/*
|
||||
** this function check if there are flags (currently only one flag) :
|
||||
** -p to print the evolution of the list while the sorting is done
|
||||
*/
|
||||
int check_flag(int *ac, char ***av)
|
||||
{
|
||||
if (ft_strcmp((*av)[1], "-p") != 0)
|
||||
@@ -27,9 +18,6 @@ int check_flag(int *ac, char ***av)
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
** create the stack for list a, as a linked list, and fill it with the values given in arguments argv
|
||||
*/
|
||||
t_stack *init_stack(int ac, char **av)
|
||||
{
|
||||
t_stack *start;
|
||||
@@ -64,13 +52,10 @@ t_list *launch_algo(t_stack *a, int flag)
|
||||
b = NULL;
|
||||
solution = ft_lstnew(&a);
|
||||
ft_lstadd_back(&solution, ft_lstnew(&b));
|
||||
print_test(solution, "launch_algo ");
|
||||
if (flag)
|
||||
fill_solution(solution, ft_strdup("start"));
|
||||
print_test(solution, "launch_algo (after fill) ");
|
||||
hugo_sort(&a, &b, solution);
|
||||
//bubble_sort(&a, &b, solution);
|
||||
print_test(solution, "launch_algo (bfr return) ");
|
||||
return (solution);
|
||||
}
|
||||
|
||||
@@ -92,8 +77,6 @@ int main(int ac, char **av)
|
||||
flag = check_flag(&ac, &av);
|
||||
stack = init_stack(ac, av);
|
||||
result = launch_algo(stack, flag);
|
||||
print_test(result, "main ");
|
||||
//sa(&stack, &result);
|
||||
print_result(result, flag);
|
||||
ps_stop(NULL, result, 0);
|
||||
return(0);
|
||||
|
||||
Reference in New Issue
Block a user