42_push_swap/ft_r.c

32 lines
1.1 KiB
C
Raw Normal View History

2022-11-23 15:44:27 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
2022-11-29 08:06:22 -05:00
/* ft_r.c :+: :+: :+: */
2022-11-23 15:44:27 -05:00
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
2022-11-29 08:06:22 -05:00
/* Created: 2022/11/28 16:50:03 by cchauvet #+# #+# */
2022-12-06 11:35:45 -05:00
/* Updated: 2022/12/01 17:42:30 by cchauvet ### ########.fr */
2022-11-23 15:44:27 -05:00
/* */
/* ************************************************************************** */
#include "pushswap.h"
2022-12-01 11:15:17 -05:00
static void ft_r(unsigned int *tab)
2022-11-23 15:44:27 -05:00
{
2022-11-29 08:06:22 -05:00
int i;
2022-11-23 15:44:27 -05:00
2022-11-29 08:06:22 -05:00
i = 0;
2022-12-01 11:15:17 -05:00
while (tab[i + 1] != STOP_VALUE)
2022-11-29 08:06:22 -05:00
{
ft_swap(tab + i, tab + i + 1);
i++;
}
2022-11-23 15:44:27 -05:00
}
2022-12-01 11:15:17 -05:00
void ft_ra(unsigned int *tab)
2022-11-23 15:44:27 -05:00
{
2022-11-29 08:06:22 -05:00
ft_r(tab);
2022-12-06 11:35:45 -05:00
ft_putstr("ra\n");
2022-11-23 15:44:27 -05:00
}