Hallo
Ich wollte in mein script
Mathe Pogramm
Noch geteilt rechnung einfügen (/) aber jetz habe ich das porblem das wenn als ergebniss einer aufgabe nach dem . ganz viele zahlen sind das er auch wen mann die aufgabe richtig gemacht hat trotztem sagt das es falsch ist woran könnte es liegen??
Quelcode:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
global $Zahl9 = Random(100, 200, 1)
global $Zahl10 = Random(1, 20, 1)
Global $ergebniss4 = $Zahl9 / $Zahl10
global $Randomzahl13 = 101
global $Randomzahl14 = 201
global $Randomzahl15 = 2
global $Randomzahl16 = 21
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 676, 551, 578, 240)
$Tab1 = GUICtrlCreateTab(0, 0, 673, 527)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet4 = GUICtrlCreateTabItem("/")
$Label9 = GUICtrlCreateLabel("Frage: Was ist " & $Zahl9 & "/" & $Zahl10 & " ?", 8, 40,999,21)
$Label10 = GUICtrlCreateLabel("", 8, 435,999,21)
;~ $Label3 = GUICtrlCreateLabel($ergebniss1, 8, 200,999,21)
$Input4 = GUICtrlCreateInput("antwort hier!!!!!", 8, 64, 641, 21)
$OK4 = GUICtrlCreateButton("OK", 288, 88, 97, 41, 0)
GUICtrlSetCursor (-1, 0)
$Leicht4 = GUICtrlCreateButton("Leicht", 24, 456, 75, 25, 0)
GUICtrlSetCursor (-1, 0)
$Mittel4= GUICtrlCreateButton("Mittel", 288, 456, 75, 25, 0)
GUICtrlSetCursor (-1, 0)
$Schwer4 = GUICtrlCreateButton("Schwer", 536, 456, 75, 25, 0)
GUICtrlSetCursor (-1, 0)
$Edit4 = GUICtrlCreateEdit("Hier könnt ihr rechnungen hinschreiben", 0, 144, 681, 281)
$Pic4 = GUICtrlCreatePic("icon.jpg",650,23,0,0)
GUICtrlSetCursor (-1, 0)
;~ GUICtrlSetData(-1, "Edit1")
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Created by lalalden", 576, 531, 94, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Leicht4
global $Randomzahl13 = 21
global $Randomzahl14 = 500
global $Randomzahl15 = 1
global $Randomzahl16 = 20
Case $Mittel4
global $Randomzahl13 = 224
global $Randomzahl14 = 1023
global $Randomzahl15 = 123
global $Randomzahl16 = 223
Case $Schwer4
global $Randomzahl13 = 2052
global $Randomzahl14 = 13526
global $Randomzahl15 = 111
global $Randomzahl16 = 2051
Case $OK4
Global $read4 = GUICtrlRead($Input4)
Global $ergebniss4 = $Zahl9 / $Zahl10
If $ergebniss4 = $read4 Then
GUICtrlSetData($Label10, "Richtig")
Sleep(20)
Test4()
Else
GUICtrlSetData($Label9, "Ihre Antwort war Falsch bitte beantworten sie die frage richtig: Was ist " & $Zahl9 & "/" & $Zahl10 & " ?")
;~ GUICtrlSetData($Label10, "Falsch " & $ergebniss4 & " bla " & $read4& " !!")
GUICtrlSetData($Label10, "Falsch")
EndIf
Case $Pic4
$ergebniss4 = $Zahl9 / $Zahl10
Sleep(40)
GUICtrlSetData($Input4,$ergebniss4)
EndSwitch
WEnd
Func Test4()
global $Zahl9 = Random($Randomzahl13, $Randomzahl14, 1)
global $Zahl10 = Random($Randomzahl15, $Randomzahl16, 1)
Global $read4 = GUICtrlRead($Input4)
GUICtrlSetData($Label9, "Nächste Frage: Was ist " & $Zahl9 & "/" & $Zahl10 & " ?")
EndFunc
MFG
Freue Mich auf antwort