Change simple algo for adaptive requierement to 02 max + norminette

This commit is contained in:
2026-01-16 12:07:14 +01:00
parent 3887e3b4a5
commit 88b7525bac
6 changed files with 10 additions and 9 deletions

View File

@@ -12,7 +12,7 @@
#include "medium_headers.h"
#include "push_swap.h"
#include <stdio.h>
static int is_border_a(int value, t_stacks *stacks)
{
t_stack *tmp;

View File

@@ -104,10 +104,12 @@ int get_pre_move_b(t_stacks *stacks, t_tab *one_preset, int range)
}
}
else
{
while (!in_range(tmp->index, one_preset->max_range, range))
{
i++;
tmp = tmp->previous;
}
}
return (i);
}

View File

@@ -12,7 +12,7 @@
#include "push_swap.h"
#include "medium_headers.h"
#include <stdio.h>
void move_rr_rrr(t_stacks *stacks, int move, char c)
{
int i;
@@ -64,7 +64,6 @@ void path_rr_rrr(int value, t_stacks *stacks, t_tab *one_preset, int range)
final_move = move_a;
move_rr_rrr(stacks, final_move, 'e');
}
}
void push_range_to_b(t_stacks *stacks, t_tab *one_preset, int range)

View File

@@ -55,7 +55,7 @@ void adaptive(t_stacks *stacks, char **tab)
while (!ft_isdigit(tab[i][0]) && tab[i])
i++;
disorder = stacks->disorder;
if (disorder < 0.3)
if (disorder < 0.2)
simple(stacks);
else if (disorder < 0.5)
medium(stacks);