random.h File Reference

#include "rng.h"
#include <map>
#include <vector>

Include dependency graph for random.h:

Go to the source code of this file.

Classes

struct  dice_def
class  rng_save_excursion
class  defer_rand

Functions

bool coinflip ()
int div_rand_round (int num, int den)
int div_round_up (int num, int den)
bool one_chance_in (int a_million)
bool x_chance_in_y (int x, int y)
int random2 (int max)
int maybe_random2 (int x, bool random_factor)
int maybe_roll_dice (int num, int size, bool random)
int random_range (int low, int high)
int random_range (int low, int high, int nrolls)
const char * random_choose_string (const char *first,...)
int random_choose (int first,...)
int random_choose_weighted (int weight, int first,...)
int random2avg (int max, int rolls)
int bestroll (int max, int rolls)
int random2limit (int max, int limit)
int binomial_generator (unsigned n_trials, unsigned trial_prob)
int fuzz_value (int val, int lowfuzz, int highfuzz, int naverage=2)
int roll_dice (int num, int size)
dice_def calc_dice (int num_dice, int max_damage)
void scale_dice (dice_def &dice, int threshold=24)
template<typename Iterator>
int choose_random_weighted (Iterator beg, const Iterator end)


Function Documentation

int bestroll ( int  max,
int  rolls 
)

Here is the call graph for this function:

int binomial_generator ( unsigned  n_trials,
unsigned  trial_prob 
)

Here is the call graph for this function:

dice_def calc_dice ( int  num_dice,
int  max_damage 
)

Here is the call graph for this function:

template<typename Iterator>
int choose_random_weighted ( Iterator  beg,
const Iterator  end 
) [inline]

Here is the call graph for this function:

bool coinflip (  ) 

Here is the call graph for this function:

int div_rand_round ( int  num,
int  den 
)

Here is the call graph for this function:

int div_round_up ( int  num,
int  den 
)

int fuzz_value ( int  val,
int  lowfuzz,
int  highfuzz,
int  naverage = 2 
)

Here is the call graph for this function:

int maybe_random2 ( int  x,
bool  random_factor 
)

Here is the call graph for this function:

int maybe_roll_dice ( int  num,
int  size,
bool  random 
)

Here is the call graph for this function:

bool one_chance_in ( int  a_million  ) 

Here is the call graph for this function:

int random2 ( int  max  ) 

Here is the call graph for this function:

int random2avg ( int  max,
int  rolls 
)

Here is the call graph for this function:

int random2limit ( int  max,
int  limit 
)

Here is the call graph for this function:

int random_choose ( int  first,
  ... 
)

Here is the call graph for this function:

const char* random_choose_string ( const char *  first,
  ... 
)

Here is the call graph for this function:

int random_choose_weighted ( int  weight,
int  first,
  ... 
)

Here is the call graph for this function:

int random_range ( int  low,
int  high,
int  nrolls 
)

Here is the call graph for this function:

int random_range ( int  low,
int  high 
)

Here is the call graph for this function:

int roll_dice ( int  num,
int  size 
)

Here is the call graph for this function:

void scale_dice ( dice_def dice,
int  threshold = 24 
)

bool x_chance_in_y ( int  x,
int  y 
)

Here is the call graph for this function:


Generated on Thu Jan 13 13:20:43 2011 by  doxygen 1.5.6