summaryrefslogtreecommitdiffstats
path: root/kiten/learn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kiten/learn.cpp')
-rw-r--r--kiten/learn.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/kiten/learn.cpp b/kiten/learn.cpp
index c9c58435..cb647aa1 100644
--- a/kiten/learn.cpp
+++ b/kiten/learn.cpp
@@ -247,7 +247,7 @@ bool Learn::queryClose()
void Learn::random()
{
- int rand = static_cast<int>(static_cast<float>(list.count()) / (static_cast<float>(RAND_MAX) / kapp->random()));
+ int rand = static_cast<int>(static_cast<float>(list.count()) / (static_cast<float>(RAND_MAX) / tdeApp->random()));
current = list.at(rand - 1);
update();
@@ -303,7 +303,7 @@ void Learn::update()
for (TQValueListIterator<Dict::Entry> it = compounds.list.begin(); it != compounds.list.end(); ++it)
{
- kapp->processEvents();
+ tdeApp->processEvents();
View->addResult(*it, true);
}
@@ -683,12 +683,12 @@ TQString Learn::randomMeaning(TQStringList &oldMeanings)
do
{
- float rand = kapp->random();
+ float rand = tdeApp->random();
if ((rand > (RAND_MAX / 2)) || (List->childCount() < numberOfAnswers))
{
// get a meaning from dict
//kdDebug() << "from our dict\n";
- rand = kapp->random();
+ rand = tdeApp->random();
float rand2 = RAND_MAX / rand;
rand = ((float)list.count() - 1) / rand2;
//rand -= 1;
@@ -711,7 +711,7 @@ TQString Learn::randomMeaning(TQStringList &oldMeanings)
{
// get a meaning from our list
//kdDebug() << "from our list\n";
- rand = kapp->random();
+ rand = tdeApp->random();
float rand2 = RAND_MAX / rand;
rand = List->childCount() / rand2;
@@ -749,7 +749,7 @@ void Learn::qupdate()
newFont.setPixelSize(24);
qKanji->setFont(newFont);
- float rand = kapp->random();
+ float rand = tdeApp->random();
float rand2 = RAND_MAX / rand;
seikai = static_cast<int>(numberOfAnswers / rand2);
@@ -787,10 +787,10 @@ void Learn::qnew() // new quiz kanji
// use f(2) every third time, f(1) otherwise
// where f(1) = numberOfItems * rand[0..1]
// and f(2) = numberOfItems * rand[0..1] * rand[0..1]
- // rand[0..1] = kapp->random() / RAND_MAX
- float max = static_cast<float>(count) / (static_cast<float>(RAND_MAX) / kapp->random());
- if (kapp->random() < (static_cast<float>(RAND_MAX) / 3.25))
- max /= (static_cast<float>(RAND_MAX) / (kapp->random() + 1));
+ // rand[0..1] = tdeApp->random() / RAND_MAX
+ float max = static_cast<float>(count) / (static_cast<float>(RAND_MAX) / tdeApp->random());
+ if (tdeApp->random() < (static_cast<float>(RAND_MAX) / 3.25))
+ max /= (static_cast<float>(RAND_MAX) / (tdeApp->random() + 1));
max = static_cast<int>(max);