-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathduplicate.c
More file actions
38 lines (35 loc) · 1.24 KB
/
duplicate.c
File metadata and controls
38 lines (35 loc) · 1.24 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* duplicate.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adbaich <adbaich@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/14 10:14:16 by adbaich #+# #+# */
/* Updated: 2022/03/15 08:00:14 by adbaich ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap_bonus.h"
#include "push_swap.h"
void check_duplicate(t_list **head_a)
{
t_list *tmp;
t_list *tmp1;
int num_check;
tmp = *head_a;
while (tmp->next)
{
num_check = tmp->content;
tmp1 = tmp->next;
while (tmp1)
{
if (tmp1->content == num_check)
{
write(1, "Error\n", 6);
exit(1);
}
tmp1 = tmp1->next;
}
tmp = tmp->next;
}
}