ca remarche et c compatible avec luke

This commit is contained in:
hugogogo
2021-06-14 11:22:45 +02:00
parent 7acfa0491e
commit ef7ffdb4dc
10 changed files with 53 additions and 83 deletions

View File

@@ -1,19 +1,18 @@
#include "pushswap.h"
void sa(t_list *pack)
t_list *sa(t_stack **stack, t_list **solution)
{
t_stack *stack_a;
t_list **solution;
int tmp;
t_stack *a;
int tmp;
stack_a = pack->content;
solution = pack->next->next->content;
if (!stack_a->next)
return ;
tmp = stack_a->n;
stack_a->n = stack_a->next->n;
stack_a->next->n = tmp;
ft_lstadd_back(solution, ft_lstnew(ft_strdup("sa")));
a = *stack;
if (!a->next)
return (NULL);
tmp = a->n;
a->n = a->next->n;
a->next->n = tmp;
fill_solution(stack, NULL, solution, ft_strdup("sa"));
return (NULL);
}