:: Игры Разума
2 x 2 = ?
reware
Автор

Сообщений: 4116
Откуда: Хабаровск
Дата регистрации: 21.07.2008
У кого-нибудь есть маленькие дети, а) которые так и тянутся к компьютеру поиграть и б) которых пора учить арифметике ? Вытащил забавную игрушку на Foxite.com.

* SHARPEN BASIC MATH SKILL
* From: Glenn Villar
* www.foxite.com
*----------------
* Math Game
* Author: GTV
*----------------
Local oForm
oForm = Createobject('TestForm')
oForm.Show()
Read Events
Return
Define Class TestForm As Form
AutoCenter = .T.
Height = 386
Width = 236
nReiterate = 0
Caption = 'Math Game'
Add Object Text1 As TxtBox With Left = 54, Top = 70
Add Object Text2 As TxtBox With Left = 54, Top = 106
Add Object Text3 As TxtBox With Left = 54, Top = 158, Enabled = .T.
Add Object Command1 As CommandButton With Caption = 'Enter Answer', ;
Autosize = .T., Left = 129, Top = 162
Add Object Label6 As Label With Caption = 'Difficulty Level:', ;
Autosize = .T., Left = 69, Top = 31
Add Object OptionGroup1 As Opg1
Add Object Label1 As Label With AutoSize = .T., Left = 12, ;
Fontsize = 36, Top = 80
Add Object Label2 As Label With FontSize = 14, AutoSize = .T., ;
Left = 29, Top = 211, FontUnderline = .T., Caption = 'Correct Answer:'
Add Object Label3 As Label With FontSize = 14, AutoSize = .T., ;
Left = 29, Top = 239, ForeColor = Rgb(96,96,96), Caption = 'Your Answer:'
Add Object Label4 As Label With Caption = 'Correct:', ;
Autosize = .T., Left = 33, Top = 287
Add Object Label5 As Label With Caption = 'Wrong:', ;
Autosize = .T., Left = 37, Top = 319
Add Object Label7 As Label With Caption = '%', AutoSize = .T., ;
Left = 58, Top = 347, FontSize = 14
Add Object Text4 As TxtBox With Left = 82, ;
Top = 280, Enabled = .F.
Add Object Text5 As TxtBox With Left = 82, Top = 312
Add Object Text6 As TxtBox With Left = 82, Top = 344, InputMask = '###'
Procedure Init
This.Setnumbers
This.Text3.SetFocus
Endproc
Procedure Setnumbers
This.Text1.Value = Ceiling(Iif(This.OptionGroup1.Value = 1,10,100)*Rand())
This.Text2.Value = Ceiling(Iif(This.OptionGroup1.Value = 1,10,100)*Rand())
This.Label1.Caption = Icase(Between(Ceiling(10*Rand()),1,4),'+', ;
Between(Ceiling(10*Rand()) ,5,8),'-','x')
Endproc
Procedure Command1.Click
Local lSign As String, lTop As Integer, lDown As Integer, lResult As Integer
Thisform.nReiterate = Thisform.nReiterate + 1
lnTop = Thisform.Text1.Value
lnDown = Thisform.Text2.Value
lcSign = Alltrim(Thisform.Label1.Caption)
lnResult = Icase(m.lcSign = '+',m.lnTop+m.lnDown,;
m.lcSign = '-',m.lnTop-m.lnDown,m.lnTop*m.lnDown)
Thisform.Label2.Caption = 'Correct Answer: '+Transform(m.lnResult)
Thisform.Label3.Caption = 'Your Answer: '+Transform(Thisform.Text3.Value)
If m.lnResult = Thisform.Text3.Value
Thisform.Text4.Value = Thisform.Text4.Value + 1
Else
Thisform.Text5.Value = Thisform.Text5.Value + 1
Endif
Thisform.Text6.Value = Round((Thisform.Text4.Value / Thisform.nReiterate) * 100,1)
Thisform.Text3.Value = 0
Thisform.Setnumbers
Thisform.Text3.SetFocus
Endproc
Procedure Destroy
Clear Events
Endproc
Enddefine
Define Class TxtBox As TextBox
Height = 31
Width = 62
DisabledBackColor = Rgb(255,255,255)
DisabledForeColor = Rgb(0,0,0)
FontSize = 14
Value = 0
SelectOnEntry = .T.
Enabled = .F.
Enddefine
Define Class Opg1 As OptionGroup
Left = 157
Top = 24
AutoSize = .T.
Add Object Option1 As OPt1 With Caption = 'Easy'
Add Object Option2 As OPt1 With Caption = 'Hard'
Enddefine
Define Class OPt1 As OptionButton
AutoSize = .T.
Enddefine
Ratings: 0 negative/0 positive


Извините, только зарегистрированные пользователи могут оставлять сообщения в этом форуме.

On-line: 4 (Гостей: 4)

© 2000-2024 Fox Club 
Яндекс.Метрика