-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.c
More file actions
30 lines (27 loc) · 1.21 KB
/
Copy pathpush.c
File metadata and controls
30 lines (27 loc) · 1.21 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lyandriy <lyandriy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/30 17:36:25 by lyandriy #+# #+# */
/* Updated: 2023/01/05 23:59:19 by lyandriy ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ft_push_stack(t_list **stack_on, t_list **stack_in, char whatstack)
{
t_list *temp;
if (stack_on[0])
{
temp = stack_on[0];
stack_on[0] = stack_on[0]->next;
temp->next = stack_in[0];
stack_in[0] = temp;
if (whatstack == 'a')
write (1, "pa\n", 3);
if (whatstack == 'b')
write (1, "pb\n", 3);
}
}