summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Kaiser2024-04-17 15:49:14 +0200
committerDominik Kaiser2024-04-17 15:49:14 +0200
commit6d5af57b81b1d180c5e0c0d8e363553771b72455 (patch)
tree018ccba6c010ca20250ff4ee070e8fd733a45de2
parentcd2231f596dd945dbf37e7d7b260d6d8950ffce7 (diff)
downloadpush_swap-6d5af57b81b1d180c5e0c0d8e363553771b72455.tar.gz
push_swap-6d5af57b81b1d180c5e0c0d8e363553771b72455.zip
Finally fix sorting
Unfortunately the performance is not good right now, but this should be rather easy to fix.
-rw-r--r--sorting.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sorting.c b/sorting.c
index dfaafe2..d6c3ada 100644
--- a/sorting.c
+++ b/sorting.c
@@ -6,10 +6,11 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/13 15:04:19 by dkaiser #+# #+# */
-/* Updated: 2024/04/17 14:17:55 by dkaiser ### ########.fr */
+/* Updated: 2024/04/17 15:48:53 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
+#include "libft/ft_printf.h"
#include "push_swap.h"
static void presort(t_psdata *data)
@@ -23,7 +24,7 @@ static void presort(t_psdata *data)
max = data->a->stack[0];
while (size--)
{
- if (data->a->stack[0] > max)
+ if (data->a->stack[0] < max)
{
run_command(data, PB);
if (data->b->stack[0] < pivot)