Page 1 of 1

PostPosted: Sun Nov 27, 2005 9:46 pm
by mark krebs
Here's a simple program. Tests your division tables.
I've been building it on PC & uploading it.
Prints hash to the screen ~20% of the time...

// Divide Test
@cid "Divd";
@name "Divide";
@dbname "DivideDB";
@ver "1.4";

main() {
int answer,a,b,w[4],correct;
alert("Hello, Kiddies!");

while(true){
a=random(13);
b=random(12)+1;
w[0]=random(13);
w[1]=random(13);
w[2]=random(13);
w[3]=random(13);
correct = random(4); // the place we'll put the answer.
answer = -1; // ensure one pass through loop.
w[correct]=a; // hide it here.

while (answer != correct){
answer=alertc("divide test",("Question: " + (a*b) + "/" + b + "= ?"),
w[0] + ":" + w[1] + ":" + w[2] + ":" + w[3],1);
if(answer==correct)
alert("Good job!");
else
alert("Nope.");
}
}
}

-mark

PostPosted: Mon Nov 28, 2005 12:53 am
by mark krebs
Fixed my problem by introducing an intermediate string variable, to contain the long concatenation of the Question and it's parameters.
don't know why this didn't work with the same text inside the alert call.



-mark