-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules2.c
42 lines (36 loc) · 1.32 KB
/
rules2.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
38
39
40
41
42
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rules2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: macos <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/11 23:10:50 by macos #+# #+# */
/* Updated: 2023/02/11 23:11:46 by macos ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void push(t_data **src, t_data **dst)
{
t_data *temp;
if (ft_lstsize(*src) == 0)
return ;
temp = *src;
*src = (*src)->next;
ft_lstadd_front(dst, temp);
}
void pa(t_data **b_push, t_data **a_push)
{
push(b_push, a_push);
write(1, "pa\n", 3);
}
void pb(t_data **a_push, t_data **b_push)
{
push(a_push, b_push);
write(1, "pb\n", 3);
}
void pp(t_data **a_push, t_data **b_push)
{
push(a_push, b_push);
write(1, "pb\n", 3);
}