mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
unimportant changes
This commit is contained in:
parent
4054afc759
commit
7f659573bc
21 changed files with 89 additions and 51 deletions
|
|
@ -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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue