-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.c
38 lines (33 loc) · 1.27 KB
/
map.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mschroed <mschroed@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/03 10:41:39 by mschroed #+# #+# */
/* Updated: 2019/01/06 19:22:35 by mschroed ### ########.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
#include <stdlib.h>
#include "fillit.h"
char **map_maker(char **mapper, int size)
{
int i;
i = -1;
mapper = malloc(sizeof(char*) * (size + 1));
mapper[size] = NULL;
while (++i < size)
{
mapper[i] = ft_strnew(size);
mapper[i] = ft_memset(mapper[i], '.', size);
}
return (mapper);
}
char **map(int size)
{
char **mapper;
mapper = map_maker(mapper, size);
return (mapper);
}