27# define FT_RAND_MAX 32768
32# define MAZE_MIN_SIZE 3
37# define MAZE_MAX_SIZE 1000
Header file for all the types and structures of the project.
struct s_pos2 t_pos2
Definition data_structure.h:36
struct s_map_raoul t_map_raoul
Definition data_structure.h:31
int cub_spawn_objects(t_map_raoul *map, int key)
Spawns a key and a door in the maze.
Definition key_door.c:86
void array_shuffle(int *arr, int len)
Shuffle an array.
Definition random.c:43
void ft_srand(unsigned int seed)
Sets the initial random state from the given seed.
Definition random.c:32
int cub_parse_generation_arg(char *gen, size_t *width, size_t *height)
Parse the argument for generation.
Definition arg.c:53
t_map_raoul * cub_new_map_from_dimensions(char *dimensions)
Allocates a new map with the given dimension.
Definition gen.c:24
int cub_growing_tree(t_map_raoul *map)
Cub3D Maze Generator, uses dimensions from gen, store them in map and create a random perfect maze.
Definition growing_tree.c:112
unsigned int ft_rand(void)
Generate a random unsigned int.
Definition random.c:37
void posvecfree(t_posvec *vec)
Free the vector.
Definition posvec.c:75
t_posvec * posvecnew(size_t size)
Create a vector with an initial starting size.
Definition posvec.c:17
int posvecremove(t_posvec *vec, size_t index, t_pos2 *result)
Removes the element at the specified index from the vector if found.
Definition posvec.c:64
int posvecpop(t_posvec *vec, t_pos2 *pos)
Pops the last element of the vector if not empty.
Definition posvec.c:54
int posvecpush(t_posvec *vec, t_pos2 data)
Add a new element to the vector.
Definition posvec.c:35
int maze_dir_x(int dir)
Maze direction on x axis.
Definition maze_direction.c:15
int maze_dir_y(int dir)
Maze direction on y axis.
Definition maze_direction.c:24
struct s_posvec t_posvec
Definition maze.h:39
int maze_dir_opp(int dir)
Maze inverted direction on x and y axis.
Definition maze_direction.c:33
Vector implementation that stores t_pos2 objects.
Definition maze.h:45
t_pos2 * data
Definition maze.h:46
size_t len
Definition maze.h:47
size_t capacity
Definition maze.h:48