From 46ed1046b3d8e9dfbb9438552582898c3c79a9f5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 4 Mar 2020 00:17:54 +0100 Subject: Chelou maps work, now sides check --- src/ft_get_map_dims.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/ft_get_map_dims.c (limited to 'src/ft_get_map_dims.c') 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 +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:47 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:47 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include +#include + +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); +} -- cgit v1.2.3