forked from anse1/sqlsmith
-
Notifications
You must be signed in to change notification settings - Fork 8
/
random.cc
35 lines (28 loc) · 639 Bytes
/
random.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "random.hh"
namespace smith {
std::mt19937_64 rng;
}
int d6() {
static std::uniform_int_distribution<> pick(1, 6);
return pick(smith::rng);
}
int d9() {
static std::uniform_int_distribution<> pick(1, 9);
return pick(smith::rng);
}
int d12() {
static std::uniform_int_distribution<> pick(1, 12);
return pick(smith::rng);
}
int d20() {
static std::uniform_int_distribution<> pick(1, 20);
return pick(smith::rng);
}
int d42() {
static std::uniform_int_distribution<> pick(1, 42);
return pick(smith::rng);
}
int d100() {
static std::uniform_int_distribution<> pick(1, 100);
return pick(smith::rng);
}