42_push_swap/ft_is_sorted.c
2022-12-01 17:15:17 +01:00

28 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_sorted.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/29 14:41:08 by cchauvet #+# #+# */
/* Updated: 2022/12/01 17:03:47 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
int ft_is_sorted(unsigned int *tab)
{
int i;
i = 0;
while (tab[i] != STOP_VALUE)
{
if (tab[1] != 0)
return (0);
i++;
}
return (1);
}