-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsa_sb.c
74 lines (63 loc) · 1.6 KB
/
sa_sb.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* sa_sb.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atyurina <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/05 15:00:50 by atyurina #+# #+# */
/* Updated: 2024/01/10 14:49:30 by atyurina ### ########.fr */
/* */
/* ************************************************************************** */
////////////////
// sa sb ss ///
////////////////
#include "push_swap.h"
void sa(long int *a, int a_len)
{
long int temp;
if (a_len >= 2)
{
temp = a[0];
a[0] = a[1];
a[1] = temp;
ft_putstr("sa\n");
}
}
void sb(long int *b, int b_len)
{
long int temp;
if (b_len >= 2)
{
temp = b[0];
b[0] = b[1];
b[1] = temp;
ft_putstr("sb\n");
}
}
static void sa_ss(long int *a, int a_len)
{
long int temp;
if (a_len >= 2)
{
temp = a[0];
a[0] = a[1];
a[1] = temp;
}
}
static void sb_ss(long int *b, int b_len)
{
long int temp;
if (b_len >= 2)
{
temp = b[0];
b[0] = b[1];
b[1] = temp;
}
}
void ss(long int *a, long int *b, int a_len, int b_len)
{
sa_ss(a, a_len);
sb_ss(b, b_len);
ft_putstr("ss\n");
}