From: Lukas Jiriste Date: Fri, 1 Mar 2024 11:02:09 +0000 (+0100) Subject: Fix a logic bug in final reverse rotation X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=1536493f5ed15e6267270b23857d9ddc6bf908a0;p=42%2Fpush_swap.git Fix a logic bug in final reverse rotation --- diff --git a/src/push.c b/src/push.c index fcf5b9d..303ee07 100644 --- a/src/push.c +++ b/src/push.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/24 13:17:32 by ljiriste #+# #+# */ -/* Updated: 2024/02/24 14:10:54 by ljiriste ### ########.fr */ +/* Updated: 2024/03/01 11:59:30 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -78,7 +78,7 @@ void rotate_a_to_sort(t_stacks *s) print_action = print_rotate; else { - minind -= s->a.stack.size / 2; + minind = s->a.stack.size - minind; print_action = print_reverse_rotate; } while (minind > 0)