mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
rename stack_functions folder to stack_utils + add stack add and stack remove functions
This commit is contained in:
31
stack_utils/rotate.c
Normal file
31
stack_utils/rotate.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user