remove test_one

This commit is contained in:
2026-01-14 13:59:05 +01:00
parent 78ec8a3fa4
commit c2e7da01f4
3 changed files with 26 additions and 42 deletions

26
main.c
View File

@@ -16,6 +16,30 @@
#include "flags.h"
#include <unistd.h>
static int push_swap(char **tab, int len, int mod)
{
t_stacks *stacks;
stacks = NULL;
if (mod == -1)
return (0);
stacks = init_stacks(len, tab, mod);
indexer(stacks);
if (!stacks)
return (0);
if (check_order(stacks->a))
{
free_all(stacks);
return (0);
}
stacks->disorder = compute_disorder(tab, wich_mod(mod));
flags(pos_flag(tab, mod), pos_bench(tab, mod), tab, stacks);
if (stacks->bench == 1)
print_bench(stacks);
free_all(stacks);
return (0);
}
int main(int argc, char **argv)
{
char **tab;
@@ -30,7 +54,7 @@ int main(int argc, char **argv)
len = len_split(tab);
mod = calcul_mod(len, tab);
if (check_error(tab, mod))
test1(tab, len, mod);
push_swap(tab, len, mod);
else
write(2, "Error\n", 6);
free_tab(tab);