-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfun_sp.c
53 lines (47 loc) · 1.43 KB
/
fun_sp.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
43
44
45
46
47
48
49
50
51
52
53
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fun_sp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bpochlau <bpochlau@student.42vienna.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/17 16:46:25 by bpochlau #+# #+# */
/* Updated: 2023/11/21 15:13:43 by bpochlau ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int ft_sa(t_vars **vars)
{
ft_s(&(*vars)->a);
ft_printf("sa\n");
return (OK);
}
int ft_sb(t_vars **vars)
{
ft_s(&(*vars)->b);
ft_printf("sb\n");
return (OK);
}
int ft_ss(t_vars **vars)
{
ft_s(&(*vars)->a);
ft_s(&(*vars)->b);
ft_printf("ss\n");
return (OK);
}
int ft_pa(t_vars **vars)
{
ft_p(&(*vars)->a, &(*vars)->b);
(*vars)->h_a += 1;
(*vars)->h_b -= 1;
ft_printf("pa\n");
return (OK);
}
int ft_pb(t_vars **vars)
{
ft_p(&(*vars)->b, &(*vars)->a);
(*vars)->h_a -= 1;
(*vars)->h_b += 1;
ft_printf("pb\n");
return (OK);
}