-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_check.c
49 lines (43 loc) · 1.24 KB
/
map_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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map_check.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lbrandy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/22 13:33:18 by lbrandy #+# #+# */
/* Updated: 2021/02/22 14:39:44 by lbrandy ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3D.h"
#include <stdio.h>
int sign_check(char sign)
{
char *temp;
temp = "012 NEWS";
while (*temp)
{
if (*temp == sign)
return (1);
temp++;
}
return (0);
}
int check_map(char **map)
{
int i;
int j;
i = 0;
while (map[i])
{
j = 0;
while (map[i][j])
{
if (!(sign_check(map[i][j])))
return (-1);
j++;
}
i++;
}
return (1);
}