Dungeonator
1.0.0
a dungeon generator library
|
various utilities used thoughout the code More...
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#include "pcg_basic.h"
#include "direction.h"
Go to the source code of this file.
Functions | |
void | seedDungeonatorRNG () |
bool | contains (int *arr, size_t start, size_t end, int element) |
void | shuffleDirections (Direction *array, int n) |
int | uniform_distribution (int rangeLow, int rangeHigh) |
various utilities used thoughout the code
bool contains | ( | int * | arr, |
size_t | start, | ||
size_t | end, | ||
int | element | ||
) |
test if an int array contains an int
time complexity O(n) (obviously)
[in] | arr | the array to check |
[in] | start | the start index to check from |
[in] | end | the end index to check to |
[in] | element | the element to check for |
void seedDungeonatorRNG | ( | ) |
seed the prng used by the dungeon generation algorithm with a non-determentistic seed
void shuffleDirections | ( | Direction * | array, |
int | n | ||
) |
shuffle the array of directions
[in,out] | array | the array to shuffle |
[in] | n | the length of the array |
int uniform_distribution | ( | int | rangeLow, |
int | rangeHigh | ||
) |
get a random number in a uniform distribution of [rangeLow, rangeHigh)
[in] | rangeLow | the lower number in the range |
[in] | rangeHigh | the higher number in the range |