38 lines
1.1 KiB
C
38 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/11/29 14:39:23 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "pushswap.h"
|
|
|
|
static void ft_r(int *tab)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (tab[i + 1] != -1)
|
|
{
|
|
ft_swap(tab + i, tab + i + 1);
|
|
i++;
|
|
}
|
|
}
|
|
|
|
void ft_ra(int *tab)
|
|
{
|
|
ft_r(tab);
|
|
ft_putstr("ra\n");
|
|
}
|
|
|
|
void ft_rb(int *tab)
|
|
{
|
|
ft_r(tab);
|
|
ft_putstr("rb\n");
|
|
}
|