• Hallo
    Habe mal wieder ein kleines Pogramm gemacht der Mathe aufgaben erstellt
    und die muss man dann lösen
    haha was man so in der langweile halt alles so macht naja

    Bitte lieber runterladen als Quelcode Benutzen wegen dem ? Icon!!
    Quelcode:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <TabConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    global $Zahl3 = Random(1, 500, 1)
    global $Zahl4 = Random(1, 20, 1)
    Global $ergebniss1 = $Zahl3 + $Zahl4
    global $Randomzahl1 = 1
    global $Randomzahl2 = 500
    global $Randomzahl3 = 1
    global $Randomzahl4 = 20

    [/autoit] [autoit][/autoit] [autoit]

    global $Zahl5 = Random(10, 25, 1)
    global $Zahl6 = Random(5, 21, 1)
    Global $ergebniss2 = $Zahl5 * $Zahl6
    global $Randomzahl5 = 10
    global $Randomzahl6 = 25
    global $Randomzahl7 = 5
    global $Randomzahl8 = 21

    [/autoit] [autoit][/autoit] [autoit]

    global $Zahl7 = Random(100, 200, 1)
    global $Zahl8 = Random(1, 20, 1)
    Global $ergebniss3 = $Zahl7 - $Zahl8
    global $Randomzahl9 = 101
    global $Randomzahl10 = 201
    global $Randomzahl11 = 2
    global $Randomzahl12 = 21

    [/autoit] [autoit][/autoit] [autoit]

    #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)
    $TabSheet1 = GUICtrlCreateTabItem("*")
    $Label5 = GUICtrlCreateLabel("Frage: Was ist " & $Zahl5 & "*" & $Zahl6 & " ?", 8, 40,999,21)
    $Label6 = GUICtrlCreateLabel("", 8, 435,999,21)
    ;~ $Label3 = GUICtrlCreateLabel($ergebniss1, 8, 200,999,21)
    $Input2 = GUICtrlCreateInput("antwort hier!!!!!", 8, 64, 641, 21)
    $OK2 = GUICtrlCreateButton("OK", 288, 88, 97, 41, 0)
    GUICtrlSetCursor (-1, 0)
    $Leicht2 = GUICtrlCreateButton("Leicht", 24, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Mittel2= GUICtrlCreateButton("Mittel", 288, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Schwer2 = GUICtrlCreateButton("Schwer", 536, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Edit2 = GUICtrlCreateEdit("Hier könnt ihr rechnungen hinschreiben", 0, 144, 681, 281)
    $Pic2 = GUICtrlCreatePic("icon.jpg",650,23,0,0)
    GUICtrlSetCursor (-1, 0)
    ;~ GUICtrlSetData(-1, "Edit1")

    [/autoit] [autoit][/autoit] [autoit]

    $TabSheet2 = GUICtrlCreateTabItem("+")
    $Label2 = GUICtrlCreateLabel("Frage: Was ist " & $Zahl3 & "+" & $Zahl4 & " ?", 8, 40,999,21)
    $Label4 = GUICtrlCreateLabel("", 8, 435,999,21)
    ;~ $Label3 = GUICtrlCreateLabel($ergebniss1, 8, 200,999,21)
    $Input1 = GUICtrlCreateInput("antwort hier!!!!!", 8, 64, 641, 21)
    $OK = GUICtrlCreateButton("OK", 288, 88, 97, 41, 0)
    GUICtrlSetCursor (-1, 0)
    $Leicht = GUICtrlCreateButton("Leicht", 24, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Mittel= GUICtrlCreateButton("Mittel", 288, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Schwer = GUICtrlCreateButton("Schwer", 536, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Edit1 = GUICtrlCreateEdit("Hier könnt ihr rechnungen hinschreiben", 0, 144, 681, 281)
    $Pic1 = GUICtrlCreatePic("icon.jpg",650,23,0,0)
    GUICtrlSetCursor (-1, 0)
    ;~ GUICtrlSetData(-1, "Edit1")

    [/autoit] [autoit][/autoit] [autoit]

    $TabSheet3 = GUICtrlCreateTabItem("-")
    $Label7 = GUICtrlCreateLabel("Frage: Was ist " & $Zahl7 & "-" & $Zahl8 & " ?", 8, 40,999,21)
    $Label8 = GUICtrlCreateLabel("", 8, 435,999,21)
    ;~ $Label3 = GUICtrlCreateLabel($ergebniss1, 8, 200,999,21)
    $Input3 = GUICtrlCreateInput("antwort hier!!!!!", 8, 64, 641, 21)
    $OK3 = GUICtrlCreateButton("OK", 288, 88, 97, 41, 0)
    GUICtrlSetCursor (-1, 0)
    $Leicht3 = GUICtrlCreateButton("Leicht", 24, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Mittel3= GUICtrlCreateButton("Mittel", 288, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Schwer3 = GUICtrlCreateButton("Schwer", 536, 456, 75, 25, 0)
    GUICtrlSetCursor (-1, 0)
    $Edit3 = GUICtrlCreateEdit("Hier könnt ihr rechnungen hinschreiben", 0, 144, 681, 281)
    $Pic3 = GUICtrlCreatePic("icon.jpg",650,23,0,0)
    GUICtrlSetCursor (-1, 0)
    ;~ GUICtrlSetData(-1, "Edit1")

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateTabItem("")
    $Label1 = GUICtrlCreateLabel("Created by lalalden", 576, 531, 94, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Leicht
    global $Randomzahl1 = 100
    global $Randomzahl2 = 200
    global $Randomzahl3 = 50
    global $Randomzahl4 = 150
    Case $Mittel
    global $Randomzahl1 = 231
    global $Randomzahl2 = 542
    global $Randomzahl3 = 66
    global $Randomzahl4 = 267
    Case $Schwer
    global $Randomzahl1 = 964
    global $Randomzahl2 = 9999
    global $Randomzahl3 = 99
    global $Randomzahl4 = 99999
    Case $OK
    Global $read1 = GUICtrlRead($Input1)
    Global $ergebniss1 = $Zahl3 + $Zahl4
    If $read1 = $ergebniss1 Then
    GUICtrlSetData($Label4, "Richtig")
    Sleep(20)
    Test()
    Else
    GUICtrlSetData($Label2, "Ihre Antwort war Falsch bitte beantworten sie die frage richtig: Was ist " & $Zahl3 & "+" & $Zahl4 & " ?")
    GUICtrlSetData($Label4, "Falsch")
    EndIf
    Case $Pic1
    $ergebniss1 = $Zahl3 + $Zahl4
    Sleep(40)
    GUICtrlSetData($Input1,$ergebniss1)

    [/autoit] [autoit][/autoit] [autoit]

    Case $Leicht2
    global $Randomzahl5 = 10
    global $Randomzahl6 = 20
    global $Randomzahl7 = 5
    global $Randomzahl8 = 21
    Case $Mittel2
    global $Randomzahl5 = 21
    global $Randomzahl6 = 101
    global $Randomzahl7 = 13
    global $Randomzahl8 = 101
    Case $Schwer2
    global $Randomzahl5 = 101
    global $Randomzahl6 = 1013
    global $Randomzahl7 = 86
    global $Randomzahl8 = 693
    Case $OK2
    Global $read2 = GUICtrlRead($Input2)
    Global $ergebniss2 = $Zahl5 * $Zahl6
    If $read2 = $ergebniss2 Then
    GUICtrlSetData($Label6, "Richtig")
    Sleep(20)
    Test2()
    Else
    GUICtrlSetData($Label5, "Ihre Antwort war Falsch bitte beantworten sie die frage richtig: Was ist " & $Zahl5 & "*" & $Zahl6 & " ?")
    GUICtrlSetData($Label6, "Falsch")
    EndIf
    Case $Pic2
    $ergebniss2 = $Zahl5 * $Zahl6
    Sleep(40)
    GUICtrlSetData($Input2,$ergebniss2)

    [/autoit] [autoit][/autoit] [autoit]

    Case $Leicht3
    global $Randomzahl9 = 21
    global $Randomzahl10 = 500
    global $Randomzahl11 = 1
    global $Randomzahl12 = 20
    Case $Mittel3
    global $Randomzahl9 = 224
    global $Randomzahl10 = 1023
    global $Randomzahl11 = 123
    global $Randomzahl12 = 223
    Case $Schwer3
    global $Randomzahl9 = 2052
    global $Randomzahl10 = 13526
    global $Randomzahl11 = 111
    global $Randomzahl12 = 2051
    Case $OK3
    Global $read3 = GUICtrlRead($Input3)
    Global $ergebniss3 = $Zahl7 - $Zahl8
    If $read3 = $ergebniss3 Then
    GUICtrlSetData($Label8, "Richtig")
    Sleep(20)
    Test3()
    Else
    GUICtrlSetData($Label7, "Ihre Antwort war Falsch bitte beantworten sie die frage richtig: Was ist " & $Zahl7 & "-" & $Zahl8 & " ?")
    GUICtrlSetData($Label8, "Falsch")
    EndIf
    Case $Pic3
    $ergebniss3 = $Zahl7 - $Zahl8
    Sleep(40)
    GUICtrlSetData($Input3,$ergebniss3)

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Test()
    global $Zahl3 = Random($Randomzahl1, $Randomzahl2, 1)
    global $Zahl4 = Random($Randomzahl3, $Randomzahl4, 1)
    Global $read1 = GUICtrlRead($Input1)
    GUICtrlSetData($Label2, "Nächste Frage: Was ist " & $Zahl3 & "+" & $Zahl4 & " ?")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Test2()
    global $Zahl5 = Random($Randomzahl5, $Randomzahl6, 1)
    global $Zahl6 = Random($Randomzahl7, $Randomzahl8, 1)
    Global $read2 = GUICtrlRead($Input2)
    GUICtrlSetData($Label5, "Nächste Frage: Was ist " & $Zahl5 & "*" & $Zahl6 & " ?")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func Test3()
    global $Zahl7 = Random($Randomzahl9, $Randomzahl10, 1)
    global $Zahl8 = Random($Randomzahl11, $Randomzahl12, 1)
    Global $read3 = GUICtrlRead($Input3)
    GUICtrlSetData($Label7, "Nächste Frage: Was ist " & $Zahl7 & "-" & $Zahl8 & " ?")
    EndFunc

    [/autoit]


    Download:


    MFG

  • Ganz nett, Ich brauch es zwar nicht aber du kannst noch %, ^, /, textaufgaben, etc einfügen :D

    Sind TV-Quizfragen zu einfach? A) Ja B) Harry Potter

    Spoiler anzeigen

    Ich gebe zu dieser Post hat wahrscheinlich nicht viel geholfen,
    aber ich versuche wenigstens zu helfen :rolleyes:

  • @xXxProGamerxXx thx die anderen werde ich noch einfügen

    RR04 thx und verstehe nicht was du meinst im jedem Tab kommt nur das ergebnis von alleine wenn man auf den fragezeichen klickt
    sry aber ich habe es wirklich nicht verstanden habe auch Im Addition Tab nach bugs gesucht aber keine Gefunden

  • Ich würde mal die Rechtschreibfehler ausbessern.
    Im Übrigen kann man Inputs erstellen, die nur eine Eingabe von Zahlen zulassen. Einfach den Parameter Style auf 8192 setzen:

    [autoit]

    GUICtrlCreateInput("Hier kannst du nur Zahlen eingeben.", 20, 20, -1, -1, 8192)

    [/autoit]
  • Hi, habe es eben noch einmal probiert.

    Ich starte das Programm und wechsle zum Tab +, hier bekomme ich die Frage und auch die Antwort, ohne selber gerechnet zu haben.


    also ich habe es mehr mals ausgetest bei mir kommt wenn ich zum Tab + wechel immer "antwort hier!!!!!"
    sry aber ich kann dazu nix sagen da dieses Problem bei mir nicht existiert.