-
Notifications
You must be signed in to change notification settings - Fork 0
/
pa_push_a.c
25 lines (22 loc) · 1.15 KB
/
pa_push_a.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pa_push_a.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ael-khni <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/12 07:51:07 by ael-khni #+# #+# */
/* Updated: 2022/01/14 11:27:07 by ael-khni ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
/* pa: push a - take the first element at the top of b and put it at top of a.
* (do nothing if b is empty). */
void pa_push_a(t_stack *a, t_stack *b)
{
if (is_empty(b))
return ;
push_elem(a, new_elem(b->top->data));
pop_elem(b);
ft_putstr("pa\n");
}