Random functions used to generated randomness.
More...
Random functions used to generated randomness.
◆ array_shuffle()
| void array_shuffle |
( |
int * | arr, |
|
|
int | len ) |
Shuffle an array.
- Parameters
-
| [in,out] | arr | array to shuffle |
| [in] | len | number of element to shuffle |
◆ cub_growing_tree()
Cub3D Maze Generator, uses dimensions from gen, store them in map and create a random perfect maze.
- Parameters
-
- Returns
- int 1 OK, 0 error
◆ cub_new_map_from_dimensions()
| t_map_raoul * cub_new_map_from_dimensions |
( |
char * | dimensions | ) |
|
Allocates a new map with the given dimension.
- Parameters
-
- Returns
- t_map_raoul* new map on success, NULL otherwise
◆ cub_parse_generation_arg()
| int cub_parse_generation_arg |
( |
char * | gen, |
|
|
size_t * | width, |
|
|
size_t * | height ) |
Parse the argument for generation.
- Parameters
-
| [in] | gen | args to parse |
| [out] | width | width of future maze |
| [out] | height | height of future maze |
- Returns
- int
◆ cub_spawn_objects()
Spawns a key and a door in the maze.
- Parameters
-
| [in,out] | map | Pointer to map |
| [in] | key | whether a key should be placed |
- Returns
- 1 OK, 0 otherwise
◆ ft_rand()
| unsigned int ft_rand |
( |
void | | ) |
|
Generate a random unsigned int.
- Returns
- unsigned int number generated
◆ ft_srand()
| void ft_srand |
( |
unsigned int | seed | ) |
|
Sets the initial random state from the given seed.
- Parameters
-