diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_get_map_dims.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/ft_get_map_dims.c b/src/ft_get_map_dims.c new file mode 100644 index 0000000..a26a891 --- /dev/null +++ b/src/ft_get_map_dims.c @@ -0,0 +1,48 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_get_map_dims.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:47 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:47 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <cub3d.h> +#include <stdlib.h> +#include <stddef.h> +#include <stdint.h> + +size_t + ft_get_map_h(char **map) +{ + size_t i; + + i = 0; + while (map[i]) + i++; + return (i); +} + +size_t + ft_get_map_w(char **map) +{ + size_t i; + size_t big; + size_t tmp; + + i = 0; + big = 0; + tmp = 0; + while (map[i]) + { + tmp = ft_strlen(map[i]); + if (tmp > big) + big = tmp; + i++; + } + return (big); +} |