rename stack_functions folder to stack_utils + add stack add and stack remove functions

This commit is contained in:
David Gailleton
2025-12-08 16:16:23 +01:00
parent 804050576b
commit 8e1bbe674c
7 changed files with 77 additions and 0 deletions

31
stack_utils/rotate.c Normal file
View File

@@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rotate.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 14:32:10 by dgaillet #+# #+# */
/* Updated: 2025/12/08 14:52:37 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ra(t_stacks *stacks)
{
if (stacks && stacks->a && stacks->a->next)
stacks->a = stacks->a->next;
}
void rb(t_stacks *stacks)
{
if (stacks && stacks->b && stacks->b->next)
stacks->b = stacks->b->next;
}
void rr(t_stacks *stacks)
{
ra(stacks);
rb(stacks);
}