-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.c
31 lines (28 loc) · 1.18 KB
/
check.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* check.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfebvay <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/02/03 21:37:22 by mfebvay #+# #+# */
/* Updated: 2015/02/03 21:38:12 by mfebvay ### ########.fr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
int checkdoubles(t_list *list)
{
t_list *current;
if (list && list->next)
{
current = list;
while (current->next)
{
if (*((int*)list->content) == *((int*)current->next->content))
return (1);
current = current->next;
}
return (checkdoubles(list->next));
}
return (0);
}