gui, font, s100 W700
Gui, Add, Text, x16 y23 w500 h140 vText1,2*2=
Gui, Add, Edit, x510 y23 w180 h140 vEdit1
gui, font, s50 W700
Gui, Add, Button, x696 y23 w170 h140 default gButtonOK vButton1,确认
jg:=jss()
Gui, Show, w875 h181, Untitled GUI
return
GuiClose:
ExitApp
ButtonOK:
GuiControlGet,buttonvar,,Button1
GuiControlGet,var1,,Edit1
if (var1=jg) {
Gui, Font, s100 cBlack
GuiControl, Font,Text1
GuiControl,,Button1,正确
Sleep,2000
Loop,3 {
GuiControl,,Button1,% "下一题" 4-A_Index
Sleep,1000
}
GuiControl,,Button1,确认
GuiControl,,Edit1
jg:=jss()
} else{
Gui, Font, s100 cRed
GuiControl, Font,Text1
GuiControl,,Button1,错误
Sleep,2000
GuiControl,,Button1,确认
GuiControl,,Edit1
}
return
jss() {
Random,ran1,1,9
Random,ran2,1,9
Random,ran3,1,4
Array1:=["+","-","*","/"]
jj:= Array1[ran3]
GuiControl,,Text1,% ran1 " " jj " " ran2 " ="
if (jj=Array1[1])
ret:=ran1+ran2
if (jj=Array1[2])
ret:=ran1-ran2
if (jj=Array1[3])
ret:=ran1*ran2
if (jj=Array1[4])
ret:=ran1/ran2
ret:=round(ret,6)
StringTrimRight,ret,ret,3
return ret
}
亲爱的朋友们,如果你认为本站不错请打赏,我们非常感谢你的支持!
[su_button url=”http://www.autoahk.com/buyamoney” style=”3d” color=”#ffe41c” size=”20″ radius=”round”]赏[/su_button]
![[趣味]动态随机出题器](https://www.autoahk.com/wp-content/uploads/2017/02/Peitu22-3-300x70.jpg)

