about summary refs log tree commit diff stats
path: root/ext/wittle_generator/Random.h
blob: 115c62d3a1e139c4b669995ca0767f3c057abee9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef RANDOM_H_F3423EE7
#define RANDOM_H_F3423EE7

#include <stdlib.h>

#include <random>

struct Random {
  static std::mt19937 gen;

  static void seed(int val) { gen = std::mt19937(val); }

  static int rand() { return abs((int)gen()); }
};

#endif /* end of include guard: RANDOM_H_F3423EE7 */