mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 08:41:58 +00:00
remove test_one
This commit is contained in:
26
main.c
26
main.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user