This commit is contained in:
Tanguy MAZE 2019-03-19 14:52:15 +01:00
parent 0b3ba46116
commit 8aa1e733ac
4 changed files with 6 additions and 13 deletions

2
libft

@ -1 +1 @@
Subproject commit 75ebffddeadd84c4330e6348e097456ccb4abe19
Subproject commit 071672f7c1a48be2d4eb4c4f9821240610d9a7b6

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/23 13:35:15 by tmaze #+# #+# */
/* Updated: 2019/03/18 17:24:12 by tmaze ### ########.fr */
/* Updated: 2019/03/19 13:41:54 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@ -77,7 +77,7 @@ int read_ops(t_psdata *data)
ft_bzero(tmp, 4);
while ((ret = ft_getline(&buff)) > 0)
{
ft_printf("checker read '%s'\n");
ft_printf("=== debug ===\nbuff: '%s'\n", buff);
ft_strncpy(tmp, buff, 3);
if (ft_strlen(buff) > 4 || !is_op(buff)
|| (nop = ft_lstnew(tmp, 4)) == NULL)

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/16 13:21:02 by tmaze #+# #+# */
/* Updated: 2019/03/18 17:36:47 by tmaze ### ########.fr */
/* Updated: 2019/03/19 12:35:27 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,7 +16,6 @@ static int join_lists(t_psdata *data, t_stack **last, int inds, int inds2)
{
while ((*last)->ind == inds2 || data->size_b > 0)
{
ft_printf("last nb %d ind %d inds2 %d\n", (*last)->nb, (*last)->ind, inds2);
if (((*last)->ind != inds2 && data->size_b > 0)
|| (data->size_b > 0 && data->b->nb > (*last)->nb))
{
@ -33,6 +32,7 @@ static int join_lists(t_psdata *data, t_stack **last, int inds, int inds2)
data->a->ind = inds;
(*last) = get_last_a(data);
}
(*last) = get_last_a(data);
}
return (1);
}
@ -67,16 +67,9 @@ int sort(t_psdata *data)
t_stack *last;
int inds;
int inds2;
t_stack *ptr;
last = get_last_a(data);
inds = last->ind + 1;
ptr = data->a;
while (ptr)
{
ft_printf("nb: %d ind %d\n", ptr->nb, ptr->ind);
ptr = ptr->next;
}
while (data->a->ind != last->ind)
{
inds2 = data->a->ind;

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/03 11:41:49 by tmaze #+# #+# */
/* Updated: 2019/03/18 15:18:04 by tmaze ### ########.fr */
/* Updated: 2019/03/19 14:51:40 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */