Melee Modding Library  2.0.0
A C library for modding Super Smash Bros Melee
random.h
Go to the documentation of this file.
1 
7 #ifndef MML_RANDOM_H
8 #define MML_RANDOM_H
9 
10 #include "gctypes.h"
11 #include "logic.h"
12 
18 float rand();
19 
25 float uniform(float a, float b);
26 
34 unsigned sample(const float* probs, size_t size);
35 
42 bool chance(FunctionArg prob);
43 
44 #endif
Data types for the gamecube.
float uniform(float a, float b)
Sample uniformly from [a, b] .
Definition: random.c:23
Function Argument.
Definition: logic.h:26
bool chance(FunctionArg prob)
Single 'coin flip' with given probability.
Definition: random.c:41
float rand()
Generate random number in [0,1].
Definition: random.c:16
Defines structs for AI logic.
unsigned sample(const float *probs, size_t size)
Return index of array according to given probabilities.
Definition: random.c:28