This commit is contained in:
Maoake Teriierooiterai
2026-01-14 11:59:30 +01:00
parent 29c60fef6a
commit 00af75f98f
2 changed files with 10 additions and 3 deletions

View File

@@ -19,7 +19,6 @@ void simple(t_stacks *stacks)
int len;
len = stack_a_len(stacks);
stacks->algo = 1;
insertion(stacks, len);
}
@@ -29,7 +28,6 @@ void medium(t_stacks *stacks)
int range;
int len;
stacks->algo = 2;
len = stack_a_len(stacks);
if (len == 2)
sort_two(stacks);
@@ -45,7 +43,6 @@ void medium(t_stacks *stacks)
void complex(t_stacks *stacks)
{
stacks->algo = 3;
radix(stacks);
}
@@ -55,6 +52,7 @@ void adaptive(t_stacks *stacks, char **tab)
float disorder;
i = 0;
stacks->algo = 4;
while (!ft_isdigit(tab[i][0]) && tab[i])
i++;
disorder = stacks->disorder;

View File

@@ -62,11 +62,20 @@ int pos_bench(char **argv, int mod)
void flags(int pos, int pos_b, char **argv, t_stacks *stacks)
{
if (ft_strncmp(argv[pos], "--simple", 30) && pos > 0)
{
stacks->algo = 1;
simple(stacks);
}
else if (ft_strncmp(argv[pos], "--medium", 30) && pos > 0)
{
stacks->algo = 2;
medium(stacks);
}
else if (ft_strncmp(argv[pos], "--complex", 30) && pos > 0)
{
stacks->algo = 3;
complex(stacks);
}
else if (ft_strncmp(argv[pos], "--adaptive", 30) && pos > 0)
adaptive(stacks, argv);
else