Add files via upload

This commit is contained in:
Raphaël 2024-04-02 09:31:55 +00:00 committed by GitHub
parent f07115aa09
commit 89b5e3aaf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 10 deletions

View file

@ -1,3 +1,4 @@
1111111
1CP00E1
1111111
1111111111111
1PCE1
11111

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/19 13:25:35 by rparodi #+# #+# */
/* Updated: 2024/03/17 00:16:49 by rparodi ### ########.fr */
/* Updated: 2024/03/10 17:55:57 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -53,9 +53,11 @@ void display_map(t_mlx *mlx)
t_image image;
size_t i;
size_t j;
size_t k;
i = 0;
j = 0;
k = 0;
while (j < mlx->map_h && mlx->map[j])
{
while (i + 1 < mlx->map_l && mlx->map[j][i] != '\0'\

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/21 22:51:53 by rparodi #+# #+# */
/* Updated: 2024/03/10 18:24:45 by rparodi ### ########.fr */
/* Updated: 2024/03/31 16:41:24 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -39,6 +39,7 @@ void map_size(t_mlx *mlx)
prev_i = 0;
while (mlx->map[j] != NULL)
{
i = 0;
while (mlx->map[j][i] != '\0' )
i++;
if (mlx->map[j][i - 1] == '\n')

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/02 15:19:03 by rparodi #+# #+# */
/* Updated: 2024/03/07 11:23:21 by rparodi ### ########.fr */
/* Updated: 2024/03/31 16:55:24 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/17 17:27:10 by rparodi #+# #+# */
/* Updated: 2024/03/10 18:23:31 by rparodi ### ########.fr */
/* Updated: 2024/03/31 16:56:32 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,7 +19,7 @@ void flood_fill(char **map, int x, int y, const char *old_value)
{
if (ft_index_strchr(old_value, map[x][y]) == 0)
return ;
map[x][y] = '.';
map[x][y] -= 32;
flood_fill(map, x + 1, y, old_value);
flood_fill(map, x - 1, y, old_value);
flood_fill(map, x, y + 1, old_value);
@ -30,14 +30,14 @@ void flood_fill(char **map, int x, int y, const char *old_value)
void ft_access(char **map, t_mlx *mlx, size_t i, size_t j)
{
size_t k;
const char old_value[4] = {'P', 'C', 'E', '0'};
const char old_value[4] = {'P', 'C', '0'};
k = 0;
flood_fill(map, j, i, old_value);
while (map[k] != NULL)
{
if (ft_index_strchr(map[k], 'C') != 0 || \
ft_index_strchr(map[k], 'E') != 0)
ft_index_strchr(map[k], 'e') != 0)
{
ft_free_maps(map, NULL);
ft_exit(mlx, NULL, 1, "The map is not finishable !");