X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/af8384344f46d799db940b950e7b92c60c63c977..280cd402a11777c2f428e110e195280d42d30aa5:/src/random.cpp?ds=inline diff --git a/src/random.cpp b/src/random.cpp index 90bfaa8..8a36882 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -47,6 +47,8 @@ void Random::Ints (std::list &lst, uint n) numeros[random + 3 * n] = true; lst.push_back (random); } + + delete [] numeros; } void Random::Strings (std::list &lst, uint n) @@ -61,3 +63,8 @@ void Random::Strings (std::list &lst, uint n) } } +double Random::Double (double min, double max) +{ + return min + max * (float)rand () / (RAND_MAX + 1.0f); +} +