cleaned up the sort but it's actually worse =/

added op cleanup function
need to work on optimising sort maybe with bottom-up
This commit is contained in:
Tanguy MAZE
2019-03-10 15:18:55 +01:00
parent d7cd178119
commit b993e0e68a
4 changed files with 72 additions and 37 deletions

View File

@@ -6,13 +6,13 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/23 13:35:15 by tmaze #+# #+# */
/* Updated: 2019/03/09 22:44:29 by tmaze ### ########.fr */
/* Updated: 2019/03/10 13:27:02 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
#define VISU_SPEED 1000000
#define VISU_SPEED 100000
void debug(t_psdata *data, char *com)
{
@@ -26,11 +26,11 @@ void debug(t_psdata *data, char *com)
while (as || bs)
{
if (as && bs)
ft_printf("%5d %4d|| %5d %4d\n", as->nb, as->ind, bs->nb, bs->ind);
ft_printf("%5d || %5d\n", as->nb, bs->nb);
else if (!as && bs)
ft_printf("%5c %4c|| %5d %4d\n", ' ', ' ', bs->nb, bs->ind);
ft_printf("%5c || %5d\n", ' ', bs->nb);
else if (as && !bs)
ft_printf("%5d %4d|| %5c %c\n", as->nb, as->ind, ' ', ' ');
ft_printf("%5d || %5c\n", as->nb, ' ');
as = (as) ? as->next : as;
bs = (bs) ? bs->next : bs;
}