Fix header file includes AND add write for each push swap functions

This commit is contained in:
David Gailleton
2025-12-12 11:40:02 +01:00
parent 1463f3e14a
commit 55363e0e6f
6 changed files with 55 additions and 19 deletions

View File

@@ -6,26 +6,32 @@
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 14:32:10 by dgaillet #+# #+# */
/* Updated: 2025/12/08 19:37:44 by mteriier ### ########.fr */
/* Updated: 2025/12/12 11:39:17 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "../push_swap.h"
#include "push_swap.h"
#include <unistd.h>
void ra(t_stacks *stacks)
{
if (stacks && stacks->a && stacks->a->next)
stacks->a = stacks->a->next;
write(1, "ra\n", 3);
}
void rb(t_stacks *stacks)
{
if (stacks && stacks->b && stacks->b->next)
stacks->b = stacks->b->next;
write(1, "rb\n", 3);
}
void rr(t_stacks *stacks)
{
ra(stacks);
rb(stacks);
if (stacks && stacks->a && stacks->a->next)
stacks->a = stacks->a->next;
if (stacks && stacks->b && stacks->b->next)
stacks->b = stacks->b->next;
write(1, "rr\n", 3);
}