X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/af8384344f46d799db940b950e7b92c60c63c977..555cf8e7b36faa768e40d09665781c468424a91c:/src/random.cpp?ds=sidebyside 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); +} +