From a408a43cd105b89a8d44292e2ef69802a5660497 Mon Sep 17 00:00:00 2001 From: Stephen Enders Date: Sat, 23 Jan 2021 11:52:32 -0500 Subject: Move source files to src folder We'll be making a few source files it'll be useful to have them organized at least somewhat from our non-src files --- random.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 random.cpp (limited to 'random.cpp') diff --git a/random.cpp b/random.cpp deleted file mode 100644 index e94b191..0000000 --- a/random.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "random.hpp" -#include -#include - -namespace ur { - -Random::Random(int min, int max) -{ - this->min = min; - this->max = max; - // setup the random stuff - unsigned seed = std::chrono::system_clock::now().time_since_epoch().count(); - this->engine = std::default_random_engine(seed); - - // setup distribution - float range = float(max - min); - this->distribution = - std::normal_distribution(range / 2.f, range / 4.f); -} - -int -Random::next() -{ - return std::round(this->distribution(this->engine)); -} - -} -- cgit v1.2.3-54-g00ecf