ca remarche et c compatible avec luke
This commit is contained in:
23
srcs/swap.c
23
srcs/swap.c
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user