Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.15 KB | None | 0 0
  1.  
  2. #include <inc\esc.au3>
  3.  
  4. dim $plus1, $plus2, $plus3, $plus4
  5. dim $minus1, $minus2, $minus3, $minus4
  6. dim $op
  7.  
  8. $op = inputbox("plus, minus, mal(1,2)","'plus', 'minus', 'mal1', 'mal2', 'rnd'")
  9.  
  10. if $op = "rnd" Then
  11.     rnd()
  12. EndIf
  13. if $op = "plus" Then
  14.     plus()
  15. EndIf
  16. if $op = "mal1" Then
  17.     mal1()
  18. EndIf
  19. if $op = "mal2" Then
  20.     mal2()
  21. EndIf
  22. if $op = "minus" Then
  23.     minus()
  24. EndIf
  25.  
  26. func plus()
  27. $plus1 = random(1,99,1)
  28. $plus2 = random(1,99,1)
  29. $plus3 = random(1,99,1)
  30. $plus4 = random(1,99,1)
  31.  
  32. $ergebnis = $plus1 + $plus2 + $plus3 + $plus4
  33.  
  34. $eingabe = inputbox("ergebnis?",$plus1 & "+" & $plus2 & "+" & $plus3 & "+" & $plus4)
  35.  
  36. while $ergebnis <> $eingabe
  37.  
  38. $eingabe = inputbox("ergebnis?",$plus1 & "+" & $plus2 & "+" & $plus3 & "+" & $plus4)
  39.  
  40. if $ergebnis = $eingabe Then
  41.     ExitLoop
  42. EndIf
  43.  
  44. WEnd
  45.  
  46. msgbox(64,"richtig",$eingabe & " ist richtig")
  47.  
  48. plus()
  49.  
  50. EndFunc
  51.  
  52. func minus()
  53. $minus1 = random(500,999,1)
  54. $minus2 = random(1,499,1)
  55.  
  56. $ergebnis = $minus1 - $minus2
  57.  
  58. $eingabe = inputbox("ergebnis?",$minus1 & "-" & $minus2)
  59.  
  60. while $ergebnis <> $eingabe
  61.  
  62. $eingabe = inputbox("ergebnis?",$minus1 & "-" & $minus2)
  63.  
  64. if $ergebnis = $eingabe Then
  65.     ExitLoop
  66. EndIf
  67.  
  68. WEnd
  69.  
  70. msgbox(64,"richtig",$eingabe & " ist richtig")
  71.  
  72. minus()
  73.  
  74. EndFunc
  75.  
  76. func mal1()
  77. $mal1 = random(1,9,1)
  78. $mal2 = random(1,9,1)
  79.  
  80. $ergebnis = $mal1 * $mal2
  81.  
  82. $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
  83.  
  84. while $ergebnis <> $eingabe
  85.  
  86. $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
  87.  
  88. if $ergebnis = $eingabe Then
  89.     ExitLoop
  90. EndIf
  91.  
  92. WEnd
  93.  
  94. msgbox(64,"richtig",$eingabe & " ist richtig")
  95.  
  96. mal1()
  97.  
  98. EndFunc
  99.  
  100. func mal2()
  101. $mal1 = random(10,99,1)
  102. $mal2 = random(10,99,1)
  103.  
  104. $ergebnis = $mal1 * $mal2
  105.  
  106. $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
  107.  
  108. while $ergebnis <> $eingabe
  109.  
  110. $eingabe = inputbox("ergebnis?",$mal1 & " * " & $mal2)
  111.  
  112. if $ergebnis = $eingabe Then
  113.     ExitLoop
  114. EndIf
  115.  
  116. WEnd
  117.  
  118. msgbox(64,"richtig",$eingabe & " ist richtig")
  119.  
  120. mal2()
  121.  
  122. EndFunc
  123.  
  124. func rnd()
  125.     $op = random(1,4,1)
  126.  
  127.     if $op = 1 Then
  128.         mal1()
  129.     EndIf
  130.     if $op = 2 Then
  131.         mal2()
  132.     EndIf
  133.     if $op = 3 Then
  134.         plus()
  135.     EndIf
  136.     if $op = 4 Then
  137.         minus()
  138.     EndIf
  139. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement