42_push_swap/ft_r.c
2022-12-09 15:22:02 +01:00

38 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_r.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/28 16:50:03 by cchauvet #+# #+# */
/* Updated: 2022/12/09 14:36:50 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
static void ft_r(unsigned int *tab)
{
int i;
i = 0;
while (tab[i + 1] != STOP_VALUE)
{
ft_swap(tab + i + 1, tab + i);
i++;
}
}
void ft_ra(unsigned int *tab)
{
ft_r(tab);
ft_putstr("ra\n");
}
void ft_rb(unsigned int *tab)
{
ft_r(tab);
ft_putstr("rb\n");
}