From 2ab51e507d620c4479e07ca0ec47d22c8c66bc90 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 13 Apr 2021 15:14:34 -0400 Subject: Initial commit --- src/dice.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/dice.h (limited to 'src/dice.h') diff --git a/src/dice.h b/src/dice.h new file mode 100644 index 0000000..f9975bc --- /dev/null +++ b/src/dice.h @@ -0,0 +1,9 @@ +#pragma once +#include + +std::mt19937 gen(std::random_device{}()); + +int roll(int d) { + std::uniform_int_distribution<> dist(1, d); + return dist(gen); +} -- cgit v1.2.3