raccourcis de fillsolution
This commit is contained in:
22
srcs/algo.c
22
srcs/algo.c
@@ -6,25 +6,16 @@ t_list *dup_n_fill(t_stack *a)
|
||||
t_list *sort;
|
||||
int *i;
|
||||
int j;
|
||||
int *x;
|
||||
|
||||
j = 0;
|
||||
i = (int *)ft_calloc(3, sizeof(int));
|
||||
sort = NULL;
|
||||
while(a)
|
||||
{
|
||||
if(sort){x = sort->content; ft_printf("[%i / ", x[0]);}
|
||||
|
||||
i = (int *)ft_calloc(3, sizeof(int));
|
||||
i[0] = a->n;
|
||||
i[1] = j;
|
||||
i[2] = 0;
|
||||
|
||||
if(sort){x = sort->content; ft_printf("%i] ", x[0]);}
|
||||
|
||||
ft_lstadd_back(&sort, ft_lstnew(i));
|
||||
|
||||
x = sort->content; ft_printf("[%i]\n", x[0]);
|
||||
|
||||
a = a->next;
|
||||
j++;
|
||||
}
|
||||
@@ -36,17 +27,7 @@ void hugo_sort(t_stack **a, t_stack **b, t_list *solution)
|
||||
(void)b;
|
||||
(void)a;
|
||||
(void)solution;
|
||||
t_list *sort;
|
||||
|
||||
sort = dup_n_fill(*a);
|
||||
int *i;
|
||||
while(sort)
|
||||
{
|
||||
i = sort->content;
|
||||
ft_printf("%i - %i - %i\n", i[0], i[1], i[2]);
|
||||
sort = sort->next;
|
||||
}
|
||||
/*
|
||||
sa(a, &solution);
|
||||
pb(b, a, &solution);
|
||||
pb(b, a, &solution);
|
||||
@@ -59,6 +40,7 @@ void hugo_sort(t_stack **a, t_stack **b, t_list *solution)
|
||||
sa(a, &solution);
|
||||
rra(a, &solution);
|
||||
rrb(b, &solution);
|
||||
/*
|
||||
rrr(a, b, &solution);
|
||||
ra(a, &solution);
|
||||
rb(b, &solution);
|
||||
|
||||
Reference in New Issue
Block a user