mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
Fix header file includes AND add write for each push swap functions
This commit is contained in:
@@ -6,26 +6,32 @@
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/08 14:43:45 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/12/08 19:37:26 by mteriier ### ########.fr */
|
||||
/* Updated: 2025/12/12 11:39:25 by dgaillet ### ########lyon.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../push_swap.h"
|
||||
#include "push_swap.h"
|
||||
#include <unistd.h>
|
||||
|
||||
void rra(t_stacks *stacks)
|
||||
{
|
||||
if (stacks && stacks->a && stacks->a->previous)
|
||||
stacks->a = stacks->a->previous;
|
||||
write(1, "rra\n", 4);
|
||||
}
|
||||
|
||||
void rrb(t_stacks *stacks)
|
||||
{
|
||||
if (stacks && stacks->b && stacks->b->previous)
|
||||
stacks->b = stacks->b->previous;
|
||||
write(1, "rrb\n", 4);
|
||||
}
|
||||
|
||||
void rrr(t_stacks *stacks)
|
||||
{
|
||||
rra(stacks);
|
||||
rrb(stacks);
|
||||
if (stacks && stacks->b && stacks->b->previous)
|
||||
stacks->b = stacks->b->previous;
|
||||
if (stacks && stacks->a && stacks->a->previous)
|
||||
stacks->a = stacks->a->previous;
|
||||
write(1, "rrr\n", 4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user