aboutsummaryrefslogtreecommitdiff
path: root/src/dice.cc
blob: dd7db558b620528ddddf543c094942e7d5832c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "dice.h"
#include <random>

namespace dice {
    std::mt19937 gen(std::random_device{}());

    int roll(int d) {
        std::uniform_int_distribution<> dist(1, d);
        return dist(gen);
    }
}