push_swap/srcs/ps_push.c
Tanguy MAZE 428525b561 Nearly there !!!
WIP merge sort
still problems with negative numbers
2019-03-06 12:12:00 +01:00

23 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ps_push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/21 15:59:46 by tmaze #+# #+# */
/* Updated: 2019/03/06 11:36:38 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int ps_push(t_psdata *data, char c)
{
t_stack *tmp;
if ((tmp = ps_stkpop(data, (c == 'a') ? 'b' : 'a')) != NULL)
ps_stkpsh(data, c, tmp);
return (tmp != NULL);
}