28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_p.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/11/09 16:38:34 by cchauvet #+# #+# */
|
||
|
/* Updated: 2022/11/17 01:13:44 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "pushswap.h"
|
||
|
|
||
|
void ft_p(int *tab_src, int *tab_dst)
|
||
|
{
|
||
|
int size_src;
|
||
|
int size_dst;
|
||
|
|
||
|
size_src = ft_get_last_index(tab_src);
|
||
|
size_dst = ft_get_last_index(tab_dst);
|
||
|
if (size_dst == 0)
|
||
|
return ;
|
||
|
size_dst--;
|
||
|
tab_src[size_src] = tab_dst[size_dst];
|
||
|
size_src++;
|
||
|
}
|