delete condition to add operation in t_stacks

This commit is contained in:
2026-01-08 13:59:09 +00:00
parent 2ba9029955
commit bb39e7d0ec
4 changed files with 26 additions and 48 deletions

View File

@@ -6,7 +6,7 @@
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 14:32:10 by dgaillet #+# #+# */
/* Updated: 2026/01/08 13:52:59 by dgaillet ### ########lyon.fr */
/* Updated: 2026/01/08 13:57:47 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
@@ -17,20 +17,16 @@ void ra(t_stacks *stacks)
{
if (stacks && stacks->a && stacks->a->next)
stacks->a = stacks->a->next;
if (stacks->bench)
stacks->ra++;
else
write(1, "ra\n", 3);
stacks->ra++;
write(1, "ra\n", 3);
}
void rb(t_stacks *stacks)
{
if (stacks && stacks->b && stacks->b->next)
stacks->b = stacks->b->next;
if (stacks->bench)
stacks->rb++;
else
write(1, "rb\n", 3);
stacks->rb++;
write(1, "rb\n", 3);
}
void rr(t_stacks *stacks)
@@ -39,8 +35,6 @@ void rr(t_stacks *stacks)
stacks->a = stacks->a->next;
if (stacks && stacks->b && stacks->b->next)
stacks->b = stacks->b->next;
if (stacks->bench)
stacks->rr++;
else
write(1, "rr\n", 3);
stacks->rr++;
write(1, "rr\n", 3);
}