-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathis_color.c
31 lines (28 loc) · 1.1 KB
/
is_color.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* is_color.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hezzahir <hamza.ezzahiry@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/04 17:56:21 by hezzahir #+# #+# */
/* Updated: 2020/01/04 17:57:35 by hezzahir ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int is_color(char *word)
{
int i;
i = 0;
if (ft_strlen(word) > 3)
return (0);
while (word[i])
{
if (!ft_isdigit(word[i]))
return (0);
i++;
}
if (ft_atoi(word) > 255)
return (0);
return (1);
}