-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_check_block_plus.c
30 lines (28 loc) · 1.32 KB
/
ft_check_block_plus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_check_block_plus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akerkeb <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/01/21 23:11:48 by akerkeb #+# #+# */
/* Updated: 2016/01/21 23:40:45 by akerkeb ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
int ft_check_block_plus(char *str, int x)
{
if (str[x - 1] == '#' && str[x - 5] == '#')
return (1);
else if (str[x + 1] == '#' && str[x - 5] == '#')
return (1);
else if (str[x + 1] == '#' && str[x + 5] == '#')
return (1);
else if (str[x - 1] == '#' && str[x + 5] == '#')
return (1);
else if (str[x - 1] == '#' && str[x + 1] == '#')
return (1);
else if (str[x - 5] == '#' && str[x + 5] == '#')
return (1);
return (0);
}