-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_check_ss.c
49 lines (44 loc) · 1.5 KB
/
ft_check_ss.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_check_ss.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marias-e <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/16 13:01:16 by marias-e #+# #+# */
/* Updated: 2022/12/20 17:34:55 by marias-e ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ft_check_sa(t_list **iter)
{
t_list *comp;
comp = (*iter)->next;
while (comp && comp->content != pa && comp->content != pb && \
comp->content != rb && comp->content != rrb)
{
if (comp->content == sb)
{
(*iter)->content = ss;
comp->content = 0;
return ;
}
comp = comp->next;
}
}
void ft_check_sb(t_list **iter)
{
t_list *comp;
comp = (*iter)->next;
while (comp && comp->content != pa && comp->content != pb && \
comp->content != ra && comp->content != rra)
{
if (comp->content == sa)
{
(*iter)->content = ss;
comp->content = 0;
return ;
}
comp = comp->next;
}
}