-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecker_swap_bonus.c
43 lines (36 loc) · 1.41 KB
/
checker_swap_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* checker_swap_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kristori <kristori@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/12 10:48:21 by kristori #+# #+# */
/* Updated: 2023/01/12 10:51:54 by kristori ### ########.fr */
/* */
/* ************************************************************************** */
#include "checker_bonus.h"
void ft_sa_checker(t_stack **stack_a)
{
t_stack *tmp;
tmp = *stack_a;
ft_swap(&tmp->data, &tmp->next->data);
tmp = tmp->next->next;
}
void ft_sb_checker(t_stack **stack_b)
{
t_stack *tmp;
tmp = *stack_b;
ft_swap(&tmp->data, &tmp->next->data);
tmp = tmp->next->next;
}
void ft_ss_checker(t_stack **stack_a, t_stack **stack_b)
{
t_stack *tmp;
tmp = *stack_a;
ft_swap(&tmp->data, &tmp->next->data);
tmp = tmp->next->next;
tmp = *stack_b;
ft_swap(&tmp->data, &tmp->next->data);
tmp = tmp->next->next;
}