unimportant changes

This commit is contained in:
Max-Wilhelm Bruker 2009-06-10 21:17:24 +02:00
parent 4054afc759
commit 7f659573bc
21 changed files with 89 additions and 51 deletions

View file

@ -1,17 +0,0 @@
#include "random.h"
#include <QDateTime>
#include <stdlib.h>
Random::Random(QObject *parent)
: QObject(parent)
{
int seed = QDateTime::currentDateTime().toTime_t();
qDebug(QString("qsrand(%1)").arg(seed).toLatin1());
qsrand(seed);
}
unsigned int Random::getNumber(unsigned int min, unsigned int max)
{
int r = qrand();
return min + (unsigned int) (((double) (max + 1 - min)) * r / (RAND_MAX + 1.0));
}