30 lines
450 B
C
30 lines
450 B
C
|
|
#include "push_swap.h"
|
|
|
|
t_list *sa(t_stack **stack, t_list **solution)
|
|
{
|
|
t_stack *a;
|
|
int tmp;
|
|
|
|
a = *stack;
|
|
if (!a->next)
|
|
return (NULL);
|
|
tmp = a->n;
|
|
a->n = a->next->n;
|
|
a->next->n = tmp;
|
|
fill_solution(solution, ft_strdup("sa"));
|
|
return (NULL);
|
|
}
|
|
|
|
t_list *sb(t_stack **b, t_list **solution)
|
|
{
|
|
return (sa(b, solution));
|
|
}
|
|
|
|
t_list *ss(t_stack **a, t_stack **b, t_list **solution)
|
|
{
|
|
sa(a, solution);
|
|
sa(b, solution);
|
|
return (NULL);
|
|
}
|