Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <inc\esc.au3>
- dim $plus1, $plus2, $plus3, $plus4
- dim $minus1, $minus2, $minus3, $minus4
- dim $op
- $op = inputbox("plus, minus, mal(1,2)","'plus', 'minus', 'mal1', 'mal2', 'rnd'")
- if $op = "rnd" Then
- rnd()
- EndIf
- if $op = "plus" Then
- plus()
- EndIf
- if $op = "mal1" Then
- mal1()
- EndIf
- if $op = "mal2" Then
- mal2()
- EndIf
- if $op = "minus" Then
- minus()
- EndIf
- func plus()
- $plus1 = random(1,99,1)
- $plus2 = random(1,99,1)
- $plus3 = random(1,99,1)
- $plus4 = random(1,99,1)
- $ergebnis = $plus1 + $plus2 + $plus3 + $plus4
- $eingabe = inputbox("ergebnis?",$plus1 & "+" & $plus2 & "+" & $plus3 & "+" & $plus4)
- while $ergebnis <> $eingabe
- $eingabe = inputbox("ergebnis?",$plus1 & "+" & $plus2 & "+" & $plus3 & "+" & $plus4)
- if $ergebnis = $eingabe Then
- ExitLoop
- EndIf
- WEnd
- msgbox(64,"richtig",$eingabe & " ist richtig")
- plus()
- EndFunc
- func minus()
- $minus1 = random(500,999,1)
- $minus2 = random(1,499,1)
- $ergebnis = $minus1 - $minus2
- $eingabe = inputbox("ergebnis?",$minus1 & "-" & $minus2)
- while $ergebnis <> $eingabe
- $eingabe = inputbox("ergebnis?",$minus1 & "-" & $minus2)
- if $ergebnis = $eingabe Then
- ExitLoop
- EndIf
- WEnd
- msgbox(64,"richtig",$eingabe & " ist richtig")
- minus()
- EndFunc
- func mal1()
- $mal1 = random(1,9,1)
- $mal2 = random(1,9,1)
- $ergebnis = $mal1 * $mal2
- $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
- while $ergebnis <> $eingabe
- $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
- if $ergebnis = $eingabe Then
- ExitLoop
- EndIf
- WEnd
- msgbox(64,"richtig",$eingabe & " ist richtig")
- mal1()
- EndFunc
- func mal2()
- $mal1 = random(10,99,1)
- $mal2 = random(10,99,1)
- $ergebnis = $mal1 * $mal2
- $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
- while $ergebnis <> $eingabe
- $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
- if $ergebnis = $eingabe Then
- ExitLoop
- EndIf
- WEnd
- msgbox(64,"richtig",$eingabe & " ist richtig")
- mal2()
- EndFunc
- func rnd()
- $op = random(1,4,1)
- if $op = 1 Then
- mal1()
- EndIf
- if $op = 2 Then
- mal2()
- EndIf
- if $op = 3 Then
- plus()
- EndIf
- if $op = 4 Then
- minus()
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement