IT WORKS !

functionning ./lem_in that can read maps and display ants path
still need to clean leaks
still need remove debug info
This commit is contained in:
Tanguy MAZE
2019-04-09 19:09:29 +02:00
parent 434b629055
commit 3b893147e5
11 changed files with 364 additions and 235 deletions

View File

@@ -6,7 +6,7 @@
/* By: mndhlovu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/02 08:39:09 by mndhlovu #+# #+# */
/* Updated: 2019/04/02 08:39:22 by mndhlovu ### ########.fr */
/* Updated: 2019/04/08 15:43:01 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,15 +14,21 @@
int lm_check_room_before(char **tab, t_syntax *synt)
{
if ((ft_atoi(tab[1]) > INT_MIN && ft_atoi(tab[1]) < INT_MAX)
&& (ft_atoi(tab[2]) > INT_MIN && ft_atoi(tab[2]) < INT_MAX)
&& !(*tab[0] == 'L' || *tab[0] == '#'))
{
return (1);
}
else
{
synt->error = 1;
return (0);
}
}
if (tab[0] != NULL && tab[1] != NULL && tab[2] != NULL)
{
if (!lm_validate_rooms(tab[0], tab[1], tab[2]))
{
synt->v_error = 1;
return (0);
}
}
return (1);
}
int lm_verify_cmd(t_syntax *synt)
{
if (synt->s_cmd && synt->e_cmd && synt->v_error
&& synt->l_error && synt->e_error)
return (1);
return (0);
}