From 20ee81a7b2d44ec985e99b4ee1bcd08fa25175d3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 23 May 2012 00:39:31 +0000 Subject: We have a nice selection of basic randomness functions now. --- src/stable/random.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/stable/random.cpp') diff --git a/src/stable/random.cpp b/src/stable/random.cpp index 725948a..63416bf 100644 --- a/src/stable/random.cpp +++ b/src/stable/random.cpp @@ -20,13 +20,28 @@ Bu::Random::~Random() pGen = NULL; } +void Bu::Random::seed( int32_t iSeed ) +{ + getInstance().pGen->seed( iSeed ); +} + int32_t Bu::Random::rand() { return getInstance().pGen->rand(); } -void Bu::Random::seed( int32_t iSeed ) +int32_t Bu::Random::rand( int32_t iMax ) { - getInstance().pGen->seed( iSeed ); + return getInstance().pGen->rand( iMax ); +} + +int32_t Bu::Random::rand( int32_t iMin, int32_t iMax ) +{ + return getInstance().pGen->rand( iMin, iMax ); +} + +double Bu::Random::randNorm() +{ + return getInstance().pGen->randNorm(); } -- cgit v1.2.3