push et swap fonctionnent
This commit is contained in:
12
srcs/print.c
12
srcs/print.c
@@ -15,14 +15,18 @@
|
||||
** a: nb nb nb nb nb
|
||||
** b: nb nb nb
|
||||
*/
|
||||
void fill_solution(t_list **solution, char *sp)
|
||||
void fill_solution(t_list *solution, char *sp)
|
||||
{
|
||||
t_stack **tmp1;
|
||||
t_stack **tmp2;
|
||||
t_stack *a;
|
||||
t_stack *b;
|
||||
char *stack;
|
||||
|
||||
a = (*solution)->content;
|
||||
b = (*solution)->next->content;
|
||||
tmp1 = solution->content;
|
||||
tmp2 = solution->next->content;
|
||||
a = *tmp1;
|
||||
b = *tmp2;
|
||||
stack = ft_strdup(sp);
|
||||
stack = ft_strjoinfree(stack, ft_strdup("!a:"));
|
||||
while(a)
|
||||
@@ -38,7 +42,7 @@ void fill_solution(t_list **solution, char *sp)
|
||||
stack = ft_strjoinfree(stack, ft_itoa(b->n));
|
||||
b = b->next;
|
||||
}
|
||||
ft_lstadd_back(solution, ft_lstnew(stack));
|
||||
ft_lstadd_back(&solution, ft_lstnew(stack));
|
||||
}
|
||||
|
||||
void print_result(t_list *result, int flag)
|
||||
|
||||
Reference in New Issue
Block a user