Push_swap/checker_folder/checker_utils.c
Alexandre POMMIER c4fd38a1ac done
2022-01-19 19:02:33 +01:00

53 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* checker_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/18 02:14:22 by apommier #+# #+# */
/* Updated: 2022/01/19 18:56:16 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
#include "../Utils/push_swap.h"
int do_move2(t_list **lst, t_list **lst_b, t_slist *a, t_slist **delete)
{
if (!ft_strcmp("rr\n", a))
{
if (!ra_rb(lst, delete, 'a'))
return (0);
if (!ra_rb(lst_b, delete, 'b'))
return (0);
}
if (!ft_strcmp("rrr\n", a))
{
if (!rra_rrb(lst, delete, 'a'))
return (0);
if (!rra_rrb(lst_b, delete, 'a'))
return (0);
}
s_lstclear(delete);
return (1);
}
int max_int(t_list *start)
{
long long swap;
t_list *lst;
lst = start;
swap = 0;
while (start)
{
swap = *(long long *)start->nbr;
if (swap > 2147483647 || swap < -2147483648)
{
return (1);
}
start = start->next;
}
return (0);
}