-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoperations3.c
45 lines (40 loc) · 1.42 KB
/
operations3.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* operations3.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fraqioui <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/24 19:13:56 by fraqioui #+# #+# */
/* Updated: 2022/12/24 19:13:57 by fraqioui ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ft_rotate_b(t_node **b_head)
{
if (!b_head || !(*b_head))
return ;
*b_head = (*b_head)->next;
}
void ft_rotate_a_b(t_node **a_head, t_node **b_head)
{
ft_rotate_a(a_head);
ft_rotate_b(b_head);
}
void ft_rev_rotate_a(t_node **a_head)
{
if (!a_head || !(*a_head))
return ;
*a_head = (*a_head)->prev;
}
void ft_rev_rotate_b(t_node **b_head)
{
if (!b_head || !(*b_head))
return ;
*b_head = (*b_head)->prev;
}
void ft_rev_rotate_a_b(t_node **a_head, t_node **b_head)
{
ft_rev_rotate_a(a_head);
ft_rev_rotate_b(b_head);
}