mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 16:51:57 +00:00
28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* check_order.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/12/09 11:57:06 by mteriier #+# #+# */
|
|
/* Updated: 2025/12/11 17:50:21 by dgaillet ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "push_swap.h"
|
|
|
|
int check_order(t_stack *stack)
|
|
{
|
|
t_stack *first;
|
|
|
|
first = stack;
|
|
while (stack->next != first)
|
|
{
|
|
if (stack->value > stack->next->value)
|
|
return (0);
|
|
stack = stack->next;
|
|
}
|
|
return (1);
|
|
}
|