Advertisement
MrPoxipol

random

Dec 25th, 2013
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #ifndef RANDOM_HPP
  2. #define RANDOM_HPP
  3.  
  4. #include <random>
  5.  
  6. namespace random
  7. {
  8.     std::random_device rd;
  9.     uint32_t seed_val;
  10.  
  11.     int randInt(int a, int b)
  12.     {
  13.         std::mt19937 gen(rd());
  14.         std::uniform_int_distribution <> dist(a, b);
  15.  
  16.         return dist(gen);
  17.     }
  18. };
  19.  
  20. #endif // RANDOM_HPP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement