Construction of the Game
Step 1: Let's Start
1. Insert an image for background.
2. Create a slider 'a' whose range is between 1 and 30. (For bases.)
3. Create two different sliders named 'a_1' and 'a_2'. The range of each slider is between 0 and 30. (For exponents.)
4. Create two different sliders named 'a_3' and 'a_4'. The range of each slider is between 1 and 1000. (For result.)
5. Create two input boxes named 't1' and 'MetinAlanı3' for each base, connect them to the slider 'a'.
6. Create an input box named 't2' for first exponent and connect it to the slider 'a_1'.
7. Create an input box named 't3' for second exponent and connect it to the slider 'a_2'.
8. Create an input box named 'ss1' for base of result and connect it to the slider 'a_3'.
9. Create an input box named 'ss2' for exponent of result and connect it to the slider 'a_4'.
10. Create text for multiplication sign between first and second bases.
11. Create text for equals sign between second base and base of result.
Step 2:
1. Create a slider 'b' whose range is between 1 and 30. (For bases.)
2. Create two different sliders named 'b_1' and 'b_2'. The range of each slider is between 0 and 30. (For exponents.)
3. Create two different sliders named 'b_3' and 'b_4'. The range of slider 'b_3' is between 1 and 1000 and the range of slider 'b_4' is between -30 and 30. (For result.)
4. Create two input boxes named 'k1' and 'MetinAlanı4' for each base, connect them to the slider 'b'.
6. Create an input box named 'k2' for first exponent and connect it to the slider 'b_1'.
7. Create an input box named 'k3' for second exponent and connect it to the slider 'b_2'.
8. Create an input box named 'gg1' for base of result and connect it to the slider 'b_3'.
9. Create an input box named 'gg2' for exponent of result and connect it to the slider 'b_4'.
10. Create text for division sign between first and second bases.
11. Create text for equals sign between second base and base of result.
Step 3:
For Multiplication:
1. Construct a button and name it as 'change base'. The script is as follows in JavaScript:
number=Math.random()*30+1;
ggbApplet.setValue('a',Math.round(number));
2. Construct a button and name it as 'change exponent 1'. The script is as follows in JavaScript:
number2=Math.random()*30+1;
ggbApplet.setValue('a_1',Math.round(number2));
3. Construct a button and name it as 'change exponent 2'. The script is as follows in JavaScript:
number3=Math.random()*30+1;
ggbApplet.setValue('a_2',Math.round(number3));
For Division:
4. Construct a button and name it as 'change base'. The script is as follows in JavaScript:
number4=Math.random()*30+1;
ggbApplet.setValue('b',Math.round(number4));
5. Construct a button and name it as 'change exponent 1'. The script is as follows in JavaScript:
number5=Math.random()*30+1;
ggbApplet.setValue('b_1',Math.round(number5));
6. Construct a button and name it as 'change exponent 2'. The script is as follows in JavaScript:
number6=Math.random()*30+1;
ggbApplet.setValue('b_2',Math.round(number6));
7. Hide all of the sliders by clicking right on "Hide objects".
8. Change the colours of buttons.
Step 4:
For Multiplication:
1. Create a text named 'metin3'.
2. Create a button and name it as 'CHECK'. The script is as follows in JavaScript:
a = ggbApplet.getValue('a');
a1 = ggbApplet.getValue('a_1');
a2 = ggbApplet.getValue('a_2');
s1 = ggbApplet.getValue('a_3');
s2 = ggbApplet. getValue("a_4");
if(a*(a1+a2) != s1*s2){
ggbApplet.setTextValue("metin3", "WRONG");
}else{
if(s2 == 1){
ggbApplet.setTextValue("metin3", "1 POINT (IMPROVE YOUR SOLUTION)");
}
else if (s1 != a){
ggbApplet.setTextValue("metin3", "10 POINTS (YOU ARE PERFECT)");
}
else{
ggbApplet.setTextValue("metin3", "5 POINTS (YOU CAN DO BETTER THAN THIS)");
}
}
For Division:
1. Create a text names 'metin5'
2. Create a button and name it as 'CHECK'. The script is as follows in JavaScript:
b = ggbApplet.getValue('b');
b1 = ggbApplet.getValue('b_1');
b2 = ggbApplet.getValue('b_2');
g1 = ggbApplet.getValue('b_3');
g2 = ggbApplet. getValue("b_4");
if(b*(b1-b2) != g1*g2){
ggbApplet.setTextValue("metin5", "WRONG");
}else{
if(g2 == 1){
ggbApplet.setTextValue("metin5", "1 POINT (IMPROVE YOUR SOLUTION)");
}
else{
ggbApplet.setTextValue("metin5", "10 POINTS (YOU ARE PERFECT)");
}
}
Step 5:
1. Create a text which includes how to play the game.
2. Construct a check box and name its caption as 'HOW TO PLAY' and connect it to the text.
HAVE FUN!