From 2c805c9506e0f0de4895cfa4d4dd5b84d8da4c75 Mon Sep 17 00:00:00 2001 From: David GAILLETON Date: Wed, 14 Jan 2026 12:04:51 +0100 Subject: [PATCH] Fix bench write size --- flags/algorithms_sort.c | 1 - flags/bench.c | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flags/algorithms_sort.c b/flags/algorithms_sort.c index be23889..c6cd752 100644 --- a/flags/algorithms_sort.c +++ b/flags/algorithms_sort.c @@ -52,7 +52,6 @@ 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; diff --git a/flags/bench.c b/flags/bench.c index 9c59efe..7a399bd 100644 --- a/flags/bench.c +++ b/flags/bench.c @@ -19,7 +19,8 @@ static void print_disorder(t_stacks *stacks) int nbr; char *str; - nbr = (int) stacks->disorder * 10000; + stacks->disorder *= 10000; + nbr = (int) stacks->disorder; str = ft_itoa(nbr); if (!str) exit (EXIT_FAILURE); @@ -41,11 +42,11 @@ static void print_algo(t_stacks *stacks) secure_write(2, "[bench] algo: ", 14); if (stacks->algo == 0) { - secure_write(2, "Adaptative", 10); + secure_write(2, "Adaptive", 8); if (stacks->disorder < 0.2) secure_write(2, " / O(n2n)\n", 10); else if (stacks->disorder >= 0.5) - secure_write(2, " / O(n√n)\n", 10); + secure_write(2, " / O(n√n)\n", 12); else secure_write(2, " / O(nlogn)\n", 12); } @@ -54,7 +55,7 @@ static void print_algo(t_stacks *stacks) else if (stacks->algo == 2) secure_write(2, "Medium / O(nlogn)\n", 18); else if (stacks->algo == 3) - secure_write(2, "Complex / O(n√n)\n", 17); + secure_write(2, "Complex / O(n√n)\n", 19); } static void print_total_ops(t_stacks *stacks)