1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen

Source Frage- und Antwortspiel

Dieses Thema im Forum "Releases & Sources" wurde erstellt von Darendeli, 29. November 2017.

  1. Darendeli

    Darendeli New Member

    Registriert seit:
    29. November 2017
    Beiträge:
    1
    Zustimmungen:
    0
    Punkte für Erfolge:
    1
    Ich überprüfe das Etikett, aber ich füge das Etikett nicht in die richtige Antwort auf der falschen Seite hinzu.
    Code (Text):
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>


    Global $SORU_SAYISI = 3
    Global $SORULAR[$SORU_SAYISI +1][8] = [[$SORU_SAYISI], _
    ["Türkiye'nin başkenti neresidir?","Adana","Istanbul","Ankara","Atina",3] , _
    ["2+7= ? işleminin sonucu kaçtır?","8","9","7","10",2], _
    ["Yılın en soğuk mevsimi hangisidir?","Kış","Ilk Bahar","Son Bahar","Yaz",1] _
    ]
    Global $dogru , $yanlis , $pas
    $dogru  = 0
    $yanlis = 0
    $pas    = 0

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 404, 315, 192, 124)
    $Label1 = GUICtrlCreateLabel("Kalan Süre : 20 Saniye", 40, 32, 109, 17)
    $Edit = GUICtrlCreateEdit("", 0, 96, 401, 113)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button3 = GUICtrlCreateButton("TAMAM", 8, 256, 185, 49)
    GUICtrlSetState(-1,$GUI_DISABLE)
    $Checkbox1 = GUICtrlCreateCheckbox("", 8, 216, 97, 27 , BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE))
    $Checkbox2 = GUICtrlCreateCheckbox("", 104, 216, 97, 27 , BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE))
    $Checkbox3 = GUICtrlCreateCheckbox("", 200, 216, 97, 27 ,BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE))
    $Checkbox4 = GUICtrlCreateCheckbox("", 296, 216, 97, 27 ,BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_PUSHLIKE))
    $Button2 = GUICtrlCreateButton("PAS GEÇ", 200, 256, 185, 49)
    $Group1 = GUICtrlCreateGroup("", 192, 24, 209, 65)
    $Label2 = GUICtrlCreateLabel("DOĞRU", 208, 40, 44, 17)
    $Label3 = GUICtrlCreateLabel("YANLIŞ", 280, 40, 42, 17)
    $Label4 = GUICtrlCreateLabel("PAS", 352, 40, 25, 17)
    $Label5 = GUICtrlCreateLabel("0", 224, 64, 20, 17)
    $Label6 = GUICtrlCreateLabel("0", 296, 64, 20, 17)
    $Label7 = GUICtrlCreateLabel("0", 360, 64, 20, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Label8 = GUICtrlCreateLabel("SKOR TABELASI", 224, 8, 144, 16)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFF0000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    AdlibRegister("time", 1000)
    _SIRADAKI_SORU()

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3
    Exit
                Case $Checkbox1
                If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
                    GUICtrlSetState($Button3, $GUI_ENABLE)
                Else
                    GUICtrlSetState($Button3, $GUI_DISABLE)
                EndIf

                Case $Checkbox2
                If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
                    GUICtrlSetState($Button3, $GUI_ENABLE)
                Else
                    GUICtrlSetState($Button3, $GUI_DISABLE)
                EndIf

                Case $Checkbox3
                If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then
                    GUICtrlSetState($Button3, $GUI_ENABLE)
                Else
                    GUICtrlSetState($Button3, $GUI_DISABLE)
                EndIf

                Case $Checkbox4
                If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then
                    GUICtrlSetState($Button3, $GUI_ENABLE)
                Else
                    GUICtrlSetState($Button3, $GUI_DISABLE)
                EndIf

                   Case $Button2
                If $SORU_SAYISI  >  $pas Then
                $pas += 1
                GUICtrlSetData($Label7,$pas)
                Else
                MsgBox (0,"Bilgi","PAS Hakkınız Bitti..")
                EndIf
                _SIRADAKI_SORU()

                Case $Button3
                _ButonaAktarim()
                _SIRADAKI_SORU()
                If @error Then _DogruYanlis()
        EndSwitch
    WEnd



    Func _ButonaAktarim()
    If GUICtrlRead($Checkbox1) = 1 Then
    $SORULAR[$SORULAR[0][1]][6] = 1
    GUICtrlSetState($Checkbox1,4)
    GUICtrlSetState($Button3,$GUI_DISABLE)
    ElseIf GUICtrlRead($Checkbox2) = 1 Then
    $SORULAR[$SORULAR[0][1]][6] = 2
    GUICtrlSetState($Checkbox2,4)
    GUICtrlSetState($Button3,$GUI_DISABLE)
    ElseIf GUICtrlRead($Checkbox3) = 1 Then
    $SORULAR[$SORULAR[0][1]][6] = 3
    GUICtrlSetState($Checkbox3,4)
    GUICtrlSetState($Button3,$GUI_DISABLE)
    ElseIf GUICtrlRead($Checkbox4) = 1 Then
    $SORULAR[$SORULAR[0][1]][6] = 4
    GUICtrlSetState($Checkbox4,4)
    GUICtrlSetState($Button3,$GUI_DISABLE)
    EndIf
    EndFunc



    Func _SIRADAKI_SORU()
    $SORULAR[0][1] += 1
    If $SORULAR[0][0] < $SORULAR[0][1] Then Return SetError(1,0,0)
    GUICtrlSetData($Edit,$SORULAR[$SORULAR[0][1]][0])
    GUICtrlSetData($label1, "Kalan Süre : 20 Saniye")
    GUICtrlSetData($Checkbox1,$SORULAR[$SORULAR[0][1]][1])
    GUICtrlSetData($Checkbox2,$SORULAR[$SORULAR[0][1]][2])
    GUICtrlSetData($Checkbox3,$SORULAR[$SORULAR[0][1]][3])
    GUICtrlSetData($Checkbox4,$SORULAR[$SORULAR[0][1]][4])
    Return True
    EndFunc

    Func _DogruYanlis()
    For $I = 1 to $SORULAR[0][0]
    If $SORULAR[$I][5] = $SORULAR[$I][6] Then
    $dogru  += 1
    GUICtrlSetData($Label5,$dogru)
    Else
    $yanlis += 1
    GUICtrlSetData($Label6,$yanlis)
    EndIf
    Next
    Exit
    EndFunc


    Func time()
        $read = GUICtrlRead($label1)
        $read = StringReplace($read, "Kalan Süre : ", "")
        $read = StringReplace($read, " Saniye", "")
        If $read > 0 Then
            GUICtrlSetData($label1, "Kalan Süre : " & $read - 1 & " Saniye")
        Else
            SoundPlay(@TempDir & "\False.mp3", 0)
            AdlibUnRegister("time")
            MsgBox(16, "Bilgi", "Malesef Süre Yetmedi. Skor Tabelasına Yanlış Olarak 1 Puan Ekliyorum..", 0, $Form1)
            GUICtrlSetData($label1, "Kalan Süre : 21 Saniye")
            AdlibRegister("time", 1000)
            $yanlis += 1
            GUICtrlSetData($label6,$yanlis)
        EndIf
    EndFunc   ;==>time

     
     

Diese Seite empfehlen

Die Seite wird geladen...