Correction pour 5 element deja ranger

This commit is contained in:
Etienne Rey-bethbeder 2022-12-29 17:47:21 +01:00
parent d1f19d6c4c
commit fb7f3f4edd
5 changed files with 2 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/23 16:48:12 by erey-bet #+# #+# */
/* Updated: 2022/12/11 15:51:26 by erey-bet ### ########.fr */
/* Updated: 2022/12/11 17:46:16 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
@ -83,10 +83,8 @@ void push_swap_5(long *tab, int len)
t_stack sb;
sa.list = get_index(tab, len);
if (sa.list == NULL)
return ;
sa.len = len;
if (init_sb(&sb, len) == NULL)
if (!init_sb(&sb, len) || !sa.list || check_sa(sa))
return ;
while (sb.len != 2)
{