a la norme

This commit is contained in:
hugogogo
2021-06-27 20:05:27 +02:00
parent f3c660cfd5
commit 98203c9ab5
5 changed files with 12 additions and 43 deletions

View File

@@ -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));