1 | #include "random.hh" |
---|---|
2 | |
3 | namespace smith { |
4 | std::mt19937_64 rng; |
5 | } |
6 | |
7 | int d6() { |
8 | static std::uniform_int_distribution<> pick(1, 6); |
9 | return pick(smith::rng); |
10 | } |
11 | |
12 | int d9() { |
13 | static std::uniform_int_distribution<> pick(1, 9); |
14 | return pick(smith::rng); |
15 | } |
16 | |
17 | int d12() { |
18 | static std::uniform_int_distribution<> pick(1, 12); |
19 | return pick(smith::rng); |
20 | } |
21 | |
22 | int d20() { |
23 | static std::uniform_int_distribution<> pick(1, 20); |
24 | return pick(smith::rng); |
25 | } |
26 | |
27 | int d42() { |
28 | static std::uniform_int_distribution<> pick(1, 42); |
29 | return pick(smith::rng); |
30 | } |
31 | |
32 | int d100() { |
33 | static std::uniform_int_distribution<> pick(1, 100); |
34 | return pick(smith::rng); |
35 | } |
36 |