version 6.30 0 Form1 1 2 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 238 268 0 0 0 Sub designer addform(Form1,"M-Train","",0,128,64)@ addtextbox(form1,TextBoxTimer,100,135,40,35,"",128,255,255,64,0,64,True,True,False,14)@ addtextbox(form1,TextBoxBad,145,135,90,35,"",128,255,255,255,0,0,True,True,False,14)@ addtextbox(form1,TextBoxGood,5,135,90,35,"",128,255,255,0,255,0,True,True,False,14)@ addtextbox(form1,TextBoxEingabe,5,95,230,35,"",64,128,128,0,0,0,True,True,False,14)@ addbutton(form1,ButtonStart,5,45,230,45,"Start",128,128,128,0,0,0,True,True,14)@ addtextbox(form1,TextBoxOperator,110,5,20,35,"",0,128,128,0,0,0,True,True,False,14)@ addtextbox(form1,TextBoxOperand2,145,5,90,35,"",0,128,128,0,0,0,True,True,False,14)@ addtextbox(form1,TextBoxOperand1,5,5,90,35,"",0,128,128,0,0,0,True,True,False,14)@ End Sub @EndOfDesignText@Sub Globals 'Declare the global variables here. Ergebniss = 0 TextBoxGood.Text = "0" TextBoxBad.Text = "0" TextBoxTimer.Text = "0" StartFlag = false End Sub Sub App_Start Form1.Show AddTimer("GameTimer") AddEvent("GameTimer",Tick,"GameTimerTick") End Sub Sub ButtonStart_Click TextBoxTimer.Text = "0" GameTimer.Enabled = true GameTimer.Interval = 1000 TextBoxOperand1.Text = Rnd(1,101) TextBoxOperand2.Text = Rnd(1,101) TextBoxEingabe.Text = "" Temp = 0 Select Rnd(1,3) Case 1 TextBoxOperator.Text = "+" Ergebniss = TextBoxOperand1.Text + TextBoxOperand2.Text Case Else TextBoxOperator.Text = "-" If TextBoxOperand1.Text < TextBoxOperand2.Text Then Temp = TextBoxOperand1.Text TextBoxOperand1.Text = TextBoxOperand2.Text TextBoxOperand2.Text = Temp End If Ergebniss = TextBoxOperand1.Text - TextBoxOperand2.Text End Select TextBoxEingabe.Focus End Sub Sub TextBoxEingabe_KeyPress (key) If TextBoxEingabe.Text & Key = Ergebniss Then ButtonStart_Click TextBoxGood.Text = TextBoxGood.Text + 1 TextBoxEingabe.IgnoreKey Else End If End Sub Sub GameTimerTick TextBoxTimer.Text = TextBoxTimer.Text + 1 If TextBoxTimer.Text > 9 Then TextBoxBad.Text = TextBoxBad.Text + 1 TextBoxTimer.Text = "0" ButtonStart_Click TextBoxEingabe.IgnoreKey End If End Sub