百人一首かるた 流しの練習用
修訂 | 145828b4aff1f437b2aec320dbcae29a04ffb28b (tree) |
---|---|
時間 | 2011-10-22 11:41:56 |
作者 | arakaki <alucky4416@user...> |
Commiter | arakaki |
BUG: Random Generation. v0.2
@@ -7,9 +7,6 @@ | ||
7 | 7 | |
8 | 8 | int RandomNumber(int min, int max) |
9 | 9 | { |
10 | - QTime midnight(0,0,0); | |
11 | - qsrand(midnight.secsTo(QTime::currentTime())); | |
12 | - | |
13 | 10 | return min + (int)(qrand() * (max - min + 1.0) / (1.0 + RAND_MAX)); |
14 | 11 | } |
15 | 12 |
@@ -18,6 +15,9 @@ int GenerateRandomNumbers(int *data, int len) | ||
18 | 15 | int i, j, rnd; |
19 | 16 | int tmp; |
20 | 17 | |
18 | + QTime midnight(0,0,0); | |
19 | + qsrand(midnight.secsTo(QTime::currentTime())); | |
20 | + | |
21 | 21 | j = len - 1; |
22 | 22 | for (i = 0; i < (len - 1); i++, j--) { |
23 | 23 | rnd = RandomNumber(0, j); |
@@ -247,7 +247,7 @@ void MainWindow::on_actionExit_triggered() | ||
247 | 247 | |
248 | 248 | void MainWindow::on_actionAbout_triggered() |
249 | 249 | { |
250 | - QMessageBox::about(this, "About", tr("流しの練習 v0.1")); | |
250 | + QMessageBox::about(this, "About", tr("流しの練習 v0.2")); | |
251 | 251 | } |
252 | 252 | |
253 | 253 | void MainWindow::on_actionAbout_Qt_triggered() |