32 lines
486 B
C
32 lines
486 B
C
|
|
#include "pushswap.h"
|
|
|
|
void fill_solution(t_stack **a, t_stack **b, t_list **solution, char *sp)
|
|
{
|
|
(void)a;
|
|
(void)b;
|
|
ft_lstadd_back(solution, ft_lstnew(sp));
|
|
}
|
|
|
|
void print_stack(t_stack *stack, char c)
|
|
{
|
|
ft_printf(" %c | ", c);
|
|
while (stack)
|
|
{
|
|
ft_printf("%i", stack->n);
|
|
stack = stack->next;
|
|
if (stack)
|
|
ft_putstr(" ");
|
|
}
|
|
ft_putchar('\n');
|
|
}
|
|
|
|
void print_result(t_list *result)
|
|
{
|
|
while (result)
|
|
{
|
|
ft_printf("%s\n", result->content);
|
|
result = result->next;
|
|
}
|
|
}
|