• salix5's avatar
    update RNG and uniform distribution (#391) · 3fe5cbdd
    salix5 authored
    DUEL_OLD_REPLAY
    The duel created by old replay files.
    It will use the original almost-uniform distribution.
    
    Random Number Generator
    C++11 has a built-in std::mersenne_twister_engine()
    It can be replaced by std::mt19937.
    
    class mt19937
    rand()
    mersenne_twister_engine std:mt19937
    
    get_random_integer()
    uniform_int_distribution based on std::mt19937
    
    shuffle_vector()
    Fisher–Yates shuffle based on get_random_integer()
    
    * update RNG and uniform distribution
    
    * add class mt19937
    
    * typos
    
    * avoid windows macro
    
    * fix rand()
    3fe5cbdd
duel.h 1.33 KB