Möchte das der Trainer die Richtigen und Falschen Antworten raufzählt bleibt aber bei 1 stehen und ich weiss echt nicht warum bitte um Hilfe.
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form2 = GUICreate("Form2", 441, 562, 195, 134)
$Addieren = GUICtrlCreateCheckbox("Addieren", 96, 24, 97, 17)
$Subtrahieren = GUICtrlCreateCheckbox("Subtrahieren", 96, 56, 97, 17)
$Dividieren = GUICtrlCreateCheckbox("Dividieren", 96, 88, 97, 17)
$Multiplizieren = GUICtrlCreateCheckbox("Multiplizieren", 96, 120, 97, 17)
$Zahlvon = GUICtrlCreateInput("", 288, 80, 81, 21)
$Zahlbis = GUICtrlCreateInput("", 288, 136, 81, 21)
$Zahlvon0bis100 = GUICtrlCreateLabel("Zahl von 0 bis 100", 288, 56, 80, 17)
$Zahlvon0bis101 = GUICtrlCreateLabel("Zahl von 0 bis 101", 288, 112, 80, 17)
$Zahlenbereich = GUICtrlCreateLabel("Zahlenbereich", 272, 16, 105, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Auf = GUICtrlCreateInput("", 48, 264, 129, 21)
$Erg = GUICtrlCreateInput("", 48, 360, 89, 21)
$Aufgabe = GUICtrlCreateLabel("Aufgabe", 48, 240, 44, 17)
$Ergebnis = GUICtrlCreateLabel("Ergebnis", 48, 336, 45, 17)
$Starten = GUICtrlCreateButton("Starten", 72, 192, 163, 25, $WS_GROUP)
$Pruefen = GUICtrlCreateButton("Prüfen", 72, 480, 163, 25, $WS_GROUP)
$Rich = GUICtrlCreateInput("", 280, 312, 97, 21)
$Fal = GUICtrlCreateInput("", 280, 368, 97, 21)
$Richtige = GUICtrlCreateLabel("Richtige", 280, 288, 43, 17)
$Falsche = GUICtrlCreateLabel("Falsche", 280, 344, 41, 17)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Starten
if GUICtrlRead ($Addieren) = $GUI_CHECKED then
$Z1 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$Z2 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$D = GUICtrlSetData($Auf, "")
$A = GUICtrlSetData($Auf, $Z1)
$B = GUICtrlSetData($Auf, " + ",$A)
$C = GUICtrlSetData($Auf,$Z2,$A)
EndIf
if GUICtrlRead ($Subtrahieren) = $GUI_CHECKED then
$Z1 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$Z2 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$D = GUICtrlSetData($Auf, "")
$A = GUICtrlSetData($Auf, $Z1)
$B = GUICtrlSetData($Auf, " - ",$A)
$C = GUICtrlSetData($Auf,$Z2,$A)
EndIf
if GUICtrlRead ($Dividieren) = $GUI_CHECKED then
$Z1 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$Z2 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$D = GUICtrlSetData($Auf, "")
$A = GUICtrlSetData($Auf, $Z1)
$B = GUICtrlSetData($Auf, " : ",$A)
$C = GUICtrlSetData($Auf,$Z2,$A)
EndIf
if GUICtrlRead ($Multiplizieren) = $GUI_CHECKED then
$Z1 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$Z2 = Random(GUICtrlRead($Zahlvon),GUICtrlRead($Zahlbis),1)
$D = GUICtrlSetData($Auf, "")
$A = GUICtrlSetData($Auf, $Z1)
$B = GUICtrlSetData($Auf, " x ",$A)
$C = GUICtrlSetData($Auf,$Z2,$A)
EndIf
Case $Pruefen
if GUICtrlRead ($Addieren) = $GUI_CHECKED then
$SZ = $Z1 + $Z2
$i = 0
if GUICtrlRead($Erg) = $SZ Then
GUICtrlSetData($Rich, $i + 1 )
$i = $i + 1
EndIf
if GUICtrlRead($Erg) <> $SZ Then
GUICtrlSetData($Fal, "1")
EndIf
EndIf
if GUICtrlRead ($Subtrahieren) = $GUI_CHECKED then
$SZ = $Z1 - $Z2
$i = 0
if GUICtrlRead($Erg) = $SZ Then
GUICtrlSetData($Rich, $i + 1 )
$i = $i + 1
EndIf
if GUICtrlRead($Erg) <> $SZ Then
GUICtrlSetData($Fal, "1")
EndIf
EndIf
if GUICtrlRead ($Dividieren) = $GUI_CHECKED then
$SZ = $Z1 / $Z2
$i = 0
if GUICtrlRead($Erg) = $SZ Then
GUICtrlSetData($Rich, $i + 1 )
$i = $i + 1
EndIf
if GUICtrlRead($Erg) <> $SZ Then
GUICtrlSetData($Fal, "1")
EndIf
EndIf
if GUICtrlRead ($Multiplizieren) = $GUI_CHECKED then
$SZ = $Z1 * $Z2
$i = 0
if GUICtrlRead($Erg) = $SZ Then
GUICtrlSetData($Rich, $i + 1 )
$i = $i + 1
EndIf
if GUICtrlRead($Erg) <> $SZ Then
GUICtrlSetData($Fal, "1")
EndIf
EndIf
EndSwitch
WEnd
Der Trainer steht noch am Anfang ich weiss das da noch viele Sachen verbessert werden müssen wie z.B. das man plus und minus gleichzeitig rechnet und so. Aber sitz da grad mal ne Stunde dran und wollte erst einmal das Wesentliche bewältigen.
MfG