42_push_swap/ft_r.c
2022-12-07 14:19:16 +01:00

32 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_r.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/28 16:50:03 by cchauvet #+# #+# */
/* Updated: 2022/12/07 13:29:57 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");
}