initial commit

This commit is contained in:
Max-Wilhelm Bruker 2009-03-13 22:50:41 +01:00
commit a11f93df4d
99 changed files with 7493 additions and 0 deletions

View file

@ -0,0 +1,18 @@
#include "testrandom.h"
#include <QThread>
void TestRandom::init()
{
if (initialized)
return;
int seed = QDateTime::currentDateTime().toTime_t();
qDebug(QString("%1: qsrand(%2)").arg(thread()->metaObject()->className()).arg(seed).toLatin1());
qsrand(seed);
initialized = true;
}
unsigned int TestRandom::getNumber(unsigned int min, unsigned int max)
{
int r = qrand();
return min + (unsigned int) (((double) (max + 1 - min)) * r / (RAND_MAX + 1.0));
}