-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.c
36 lines (29 loc) · 1.23 KB
/
push.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfebvay <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/02/03 05:29:42 by mfebvay #+# #+# */
/* Updated: 2015/02/03 05:48:36 by mfebvay ### ########.fr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
static void push(t_list **dest, t_list **src)
{
t_list *to_push;
to_push = *src;
*src = (*src)->next;
ft_lstadd(dest, to_push);
}
void push_a(t_list **dest, t_list **src, t_list **moves)
{
push(dest, src);
add_move("pa", moves);
}
void push_b(t_list **dest, t_list **src, t_list **moves)
{
push(dest, src);
add_move("pb", moves);
}