-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_items.c
37 lines (32 loc) · 1.18 KB
/
push_items.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
26
27
28
29
30
31
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_items.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mohkhald <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/21 21:48:46 by mohkhald #+# #+# */
/* Updated: 2025/04/03 01:01:50 by mohkhald ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ft_push(t_stack **a, t_stack **b)
{
t_stack *tmp;
if (!(*b))
return ;
tmp = *b;
*b = (*b)->next;
tmp->next = *a;
*a = tmp;
}
void pa(t_stack **a, t_stack **b)
{
ft_push(a, b);
write(1, "pa\n", 3);
}
void pb(t_stack **b, t_stack **a)
{
ft_push(b, a);
write(1, "pb\n", 3);
}