functions standardisees, annotees et readme en cours decriture
This commit is contained in:
23
srcs/algo.c
23
srcs/algo.c
@@ -1,28 +1,11 @@
|
||||
|
||||
#include "pushswap.h"
|
||||
#include "push_swap.h"
|
||||
|
||||
void hugo_sort(t_stack **a, t_list **solution)
|
||||
void hugo_sort(t_stack **a, t_stack **b, t_list **solution)
|
||||
{
|
||||
(void)b;
|
||||
sa(a, solution);
|
||||
sa(a, solution);
|
||||
sa(a, solution);
|
||||
}
|
||||
|
||||
/*
|
||||
** this function creates the stack b and the list solution
|
||||
** then it calls the sorting algorithm
|
||||
** then it frees everything that needs to be freed
|
||||
*/
|
||||
|
||||
t_list *sort_algo(t_stack *a)
|
||||
{
|
||||
t_stack *b;
|
||||
t_list *solution;
|
||||
|
||||
solution = NULL;
|
||||
if(!(b = ft_calloc(1, sizeof(t_stack))))
|
||||
ps_stop(a, b, NULL, 2);
|
||||
hugo_sort(&a, &solution);
|
||||
ps_stop(NULL, b, NULL, -1);
|
||||
return (solution);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user