Mein Problem besteht darin das ich ein Zufallsgenerator habe der auch recht gut funktioniert, Dennoch sendet der nicht alle arrays 1 mal sondern hört dann auf wann er irgendwie lust hat ![]()
Quelltext
Spoiler anzeigen
Global $banzahl = "26"
Global $wert4 = "1"
Global $wert5 = "1"
Global $wert6 = "1"
Global $wert7 = "1"
Global $wert8 = "1"
$check4 = GUICtrlRead($Checkbox4)
$check5 = GUICtrlRead($Checkbox5)
$check6 = GUICtrlRead($Checkbox6)
$check7 = GUICtrlRead($Checkbox7)
$check8 = GUICtrlRead($Checkbox8)
Local $array[26]
$array[0]="A"
$array[1]="B"
$array[2]="C"
$array[3]="D"
$array[4]="E"
$array[5]="F"
$array[6]="G"
$array[7]="H"
$array[8]="I"
$array[9]="J"
$array[10]="K"
$array[11]="L"
$array[12]="M"
$array[13]="N"
$array[14]="O"
$array[15]="P"
$array[16]="Q"
$array[17]="R"
$array[18]="S"
$array[19]="T"
$array[20]="U"
$array[21]="V"
$array[22]="W"
$array[23]="X"
$array[24]="Y"
$array[25]="Z"
While 1
$check4 = GUICtrlRead($Checkbox4)
$check5 = GUICtrlRead($Checkbox5)
$check6 = GUICtrlRead($Checkbox6)
$check7 = GUICtrlRead($Checkbox7)
$check8 = GUICtrlRead($Checkbox8)
$nMsg = GUIGetMsg ()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
;positive checkbox
If $check4 = "1" Then
If $wert4 = "1" Then
$banzahl += "1"
$wert4 -= "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check5 = "1" Then
If $wert5 = "1" Then
$banzahl += "1"
$wert5 -= "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check6 = "1" Then
If $wert6 = "1" Then
$banzahl += "1"
$wert6 -= "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check7 = "1" Then
If $wert7 = "1" Then
$banzahl += "1"
$wert7 -= "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check8 = "1" Then
If $wert8 = "1" Then
$banzahl += "1"
$wert8 -= "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
;negative checkbox
If $check4 = "4" Then
If $wert4 = "0" Then
$banzahl -= "1"
$wert4 += "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check5 = "4" Then
If $wert5 = "0" Then
$banzahl -= "1"
$wert5 += "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check6 = "4" Then
If $wert6 = "0" Then
$banzahl -= "1"
$wert6 += "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check7 = "4" Then
If $wert7 = "0" Then
$banzahl -= "1"
$wert7 += "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
If $check8 = "4" Then
If $wert8 = "0" Then
$banzahl -= "1"
$wert8 += "1"
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
EndIf
EndIf
if $nMsg = -3 Then Exit
If $Start = $nMsg Then
_AZ($AZ)
EndIf
WEnd
;Buchstabengenerator
Func _AZ($AZ)
Do
$nMsg = GUIGetMsg ()
$y = Ubound($array)-1
$i = Round(Random (0, $y))
GUICtrlSetData ($AZ, $array[$i])
Until $Stopp = $nMsg
If $i > 0 Then
_ArrayDelete($array,$i)
$banzahl -= "1"
$buchstabe = GUICtrlRead($AZ)
If $buchstabe = "W" And $check8 = "4" Then
$wert8 += "5"
Return
EndIf
If $buchstabe = "Q" And $check7 = "4" Then
$wert7 += "5"
Return
EndIf
If $buchstabe = "Z" And $check6 = "4" Then
$wert6 += "5"
Return
EndIf
If $buchstabe = "Y" And $check5 = "4" Then
$wert5 += "5"
Return
EndIf
If $buchstabe = "X" And $check4 = "4" Then
$wert4 += "5"
Return
EndIf
GUICtrlSetData ($banzahllabel, "Übrige Buchstaben: " & $banzahl)
GUICtrlSetData ($buchstabelabel, $buchstabe)
_alle()
Else
MsgBox(0,"Ende","alle Buchstaben waren 1x mal dran!",5)
Exit
EndIf
EndFunc