Files
42_INT_06_pushwap/srcs/swap.c

20 lines
331 B
C

#include "pushswap.h"
void sa(t_list *pack)
{
t_stack *stack_a;
t_list **solution;
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")));
}