a la norme
This commit is contained in:
10
srcs/print.c
10
srcs/print.c
@@ -1,8 +1,8 @@
|
||||
|
||||
#include "push_swap.h"
|
||||
|
||||
/*
|
||||
** this function fill a new element on the chained list like this :
|
||||
** this function is called by actions like sa()
|
||||
** it fills a new element on the chained list like this :
|
||||
** name!a: nb nb nb nb nb!b: nb nb nb
|
||||
**
|
||||
** it will later be printed like this ("!" is the char to split) :
|
||||
@@ -10,7 +10,7 @@
|
||||
** a: nb nb nb nb nb
|
||||
** b: nb nb nb
|
||||
**
|
||||
** or only "name" if not flag -p
|
||||
** or only "name" if no flag -p
|
||||
*/
|
||||
void fill_solution(t_list *solution, char *sp)
|
||||
{
|
||||
@@ -21,14 +21,14 @@ void fill_solution(t_list *solution, char *sp)
|
||||
a = *(t_stack **)(solution->content);
|
||||
b = *(t_stack **)(solution->next->content);
|
||||
stack = ft_strjoinfree(ft_strdup(sp), ft_strdup("!a:"));
|
||||
while(a != NULL)
|
||||
while (a != NULL)
|
||||
{
|
||||
stack = ft_strjoinfree(stack, ft_strdup(" "));
|
||||
stack = ft_strjoinfree(stack, ft_itoa(a->n));
|
||||
a = a->next;
|
||||
}
|
||||
stack = ft_strjoinfree(stack, ft_strdup("!b:"));
|
||||
while(b != NULL)
|
||||
while (b != NULL)
|
||||
{
|
||||
stack = ft_strjoinfree(stack, ft_strdup(" "));
|
||||
stack = ft_strjoinfree(stack, ft_itoa(b->n));
|
||||
|
||||
Reference in New Issue
Block a user