Add bench mode and algo in t_stacks

This commit is contained in:
2026-01-08 13:54:29 +00:00
parent 765ec373e5
commit 2ba9029955
6 changed files with 84 additions and 21 deletions

View File

@@ -6,7 +6,7 @@
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 15:09:40 by mteriier #+# #+# */
/* Updated: 2025/12/12 11:39:33 by dgaillet ### ########lyon.fr */
/* Updated: 2026/01/08 13:52:01 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
@@ -30,7 +30,10 @@ void pa(t_stacks *stacks)
stacks->b = stacks->b->next;
}
stack_add_front(&(stacks->a), b_push);
write(1, "pa\n", 3);
if (stacks->bench)
stacks->pa++;
else
write(1, "pa\n", 3);
}
void pb(t_stacks *stacks)
@@ -49,5 +52,8 @@ void pb(t_stacks *stacks)
stacks->a = stacks->a->next;
}
stack_add_front(&(stacks->b), a_push);
write(1, "pb\n", 3);
if (stacks->bench)
stacks->pb++;
else
write(1, "pb\n", 3);
}