How can you construct the game?
- Start with creating a slider whose interval is between 1 to 50 and increment is 1.
- Go to "Steps" menu and create an input b=RandomBetween(1,50)
- Create a second input a=RandomBetween(0,b-1).
- Form the third input as Fraction=a/b.
- Drag this input with right click and drop on the main page.
- Form a text box(text2) named as "Response".
- Create a button whose caption is "Change Fraction".
- Create another 3 buttons named as "Close to zero", "Close to half" and "Close to whole".
- Go to the settings of the "Change Fraction" button with right click on it.
- In settings, firstly go to "scripting" and then "on click". Write b=RandomBetween(1,50)
SetColor(button2,gray) SetColor(button3,gray) Setcolor(button4,gray)
11. Right click on the "Close to zero" button, go to settings>scripting>on click. Write
If(0<=Fraction<=0.24, SetValue(text2,"That's True!"))
If(Fraction>0.24,SetValue(text2,"No"))
If(0<=Fraction<=0.24, SetColor(button2,green))
If(Fraction>0.24, SetColor(button2,red))
12. Right click on the "Close to half" button, go to settings>scripting>on click. Write If(0.25<=Fraction<=0.74, SetValue(text2,"Great :)"))
If(Fraction>0.74 ,SetValue(text2,"Try Again :("))
If(Fraction<0.24 ,SetValue(text2,"Think Again"))
If(0.25<=Fraction<=0.74, SetColor(button3,green))
If(Fraction>0.74,SetColor(button3,red))
If(Fraction<0.24,SetColor(button3,red))
13. Right click on the "Close to whole" button, go to settings>scripting>on click. Write If(0.75<=Fraction<=1, SetValue(text2,"Congratulations! .)"))
If(Fraction<0.74,SetValue(text2,"Sorry"))
If(0.75<=Fraction<=1, SetColor(button4,green))
If(Fraction<0.74,SetColor(button4,red))
14. Go to the settings of the "Change Fraction" with right click on it. Go to settings>scripting>on click and add SetValue(text2," ")
15. Now, you can improve design of your tool to make it visually attractive if you want :)