-
Notifications
You must be signed in to change notification settings - Fork 0
/
map2.c
49 lines (45 loc) · 1.41 KB
/
map2.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
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zbabahmi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/11 03:12:45 by zbabahmi #+# #+# */
/* Updated: 2023/04/12 03:21:09 by zbabahmi ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
void check_num(t_savage *criminal, int y, int x)
{
int i;
i = 0;
while (i != x)
{
check_num_help(criminal, i, y);
i++;
}
i = 0;
while (i != y)
{
if (criminal->map[i][0] != '1' || criminal->map[i][x - 1] != '1')
{
ft_printf("ERROR : machi 1\n");
exit (1);
}
i++;
}
}
void check_num_help(t_savage *criminal, int i, int y)
{
if (criminal->map[0][i] != '1')
{
ft_printf("ERROR : maxi 1\n");
exit (1);
}
if (criminal->map[y - 1][i] != '1')
{
ft_printf("ERROR : maxi 1\n");
exit (1);
}
}