functions standardisees, annotees et readme en cours decriture

This commit is contained in:
hugogogo
2021-06-14 21:40:05 +02:00
parent 7a0f44c676
commit 5050e05816
17 changed files with 222 additions and 128 deletions

View File

@@ -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);
}