Working demonstration

This commit is contained in:
Timo Schmidt 2023-04-05 10:24:49 +02:00
parent 37784434d0
commit 25876a36d5
9 changed files with 34 additions and 4 deletions

BIN
obj/io.o Normal file

Binary file not shown.

BIN
obj/main.o Normal file

Binary file not shown.

BIN
obj/map_helpers.o Normal file

Binary file not shown.

BIN
obj/parsing.o Normal file

Binary file not shown.

BIN
obj/parsing_simple.o Normal file

Binary file not shown.

BIN
obj/printing.o Normal file

Binary file not shown.

BIN
obj/solution.o Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */ /* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/04 21:50:50 by tischmid #+# #+# */ /* Created: 2023/04/04 21:50:50 by tischmid #+# #+# */
/* Updated: 2023/04/05 10:05:40 by tischmid ### ########.fr */ /* Updated: 2023/04/05 10:18:04 by tischmid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,12 +15,43 @@
#include "printing.h" #include "printing.h"
#include "ft_string.h" #include "ft_string.h"
void debug_set_map(t_map *map)
{
char *str;
str = \
"........................................" \
"...................X...................." \
".........................X..........X..." \
"..............X........................." \
".........X...........................X.." \
"............X..X........................" \
"..................................X....." \
"....................................X..." \
"........................................" \
"X.X..........................X.........." \
"....X.................................X." \
"..........X............................." \
".............................X.........." \
"....................X......X............" \
"............................X...X......X" \
".......X........X....X....X..XX........." \
"................X........X............X." \
"................X......X................" \
"....X................X.......X.........." \
"........................................";
map->data = malloc(sizeof(char) * (ft_strlen(str) + 1));
ft_strcpy(map->data, str);
}
int main(void) int main(void)
{ {
t_map map; t_map map;
if (!read_fname("./assets/subject.map", &map)) if (!read_fname("./assets/map20x40.map", &map))
return (ft_err("map error\n", 1)); return (ft_err("map error\n", 1));
free(map.data);
debug_set_map(&map);
map.copy = malloc(sizeof(char) * (ft_strlen(map.data) + 1)); map.copy = malloc(sizeof(char) * (ft_strlen(map.data) + 1));
ft_strcpy(map.copy, map.data); ft_strcpy(map.copy, map.data);
solve(&map); solve(&map);

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */ /* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/05 04:09:39 by tischmid #+# #+# */ /* Created: 2023/04/05 04:09:39 by tischmid #+# #+# */
/* Updated: 2023/04/05 10:00:23 by tischmid ### ########.fr */ /* Updated: 2023/04/05 10:19:12 by tischmid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -57,7 +57,6 @@ void print_map(t_map *map, int as_numbers)
int i; int i;
int j; int j;
ft_putstr("\nMap 2d:\n");
i = -1; i = -1;
while (++i < map->meta.height) while (++i < map->meta.height)
{ {