so_long/games/enemy2.c
2023-01-06 19:16:12 +01:00

37 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* enemy2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/06 19:06:57 by erey-bet #+# #+# */
/* Updated: 2023/01/06 19:06:58 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#include "../so_long.h"
int ft_strslen(char **src)
{
int i;
i = 0;
while (src[i])
i++;
return (i);
}
int choice(int **map, int *i, int x, int y)
{
if (map[x][y] != -1)
{
if (*i == -1 || map[x][y] < *i)
{
*i = map[x][y];
return (1);
}
}
return (0);
}