#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$titel = "Card Machine | campweb"


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate(""&$titel, 625, 443, 391, 172)
$cns = GUICtrlCreateEdit("Start Test"&@CRLF, 1, 1, 622, 440)
GUICtrlSetFont(-1, 8, 800, 0, "Courier")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$rt = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(50))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt&@CRLF)

$rt2 = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt($rt))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt2&@CRLF)

$rt3 = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt($rt2))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt3&@CRLF)

$rt4 = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt($rt3))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt4&@CRLF)

$rt5 = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt($rt4))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt5&@CRLF)

$rt6 = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt($rt5))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt6&@CRLF)

$rt7 = Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt(Sqrt($rt6))))))))
GUICtrlSetData($cns, guictrlread($cns)& $rt7&@CRLF)

If $rt7 = 1 Then
	GUICtrlSetData($cns, guictrlread($cns)& "Test finished: OK" &@CRLF&@CRLF)
Else
	GUICtrlSetData($cns, guictrlread($cns)& "Test finished: SHIT" &@CRLF&@CRLF)
EndIf


GUICtrlSetData($cns, guictrlread($cns)& "============================" &@CRLF)
GUICtrlSetData($cns, guictrlread($cns)& "#       Cards Machine      #" &@CRLF)
GUICtrlSetData($cns, guictrlread($cns)& "============================" &@CRLF)
GUICtrlSetData($cns, guictrlread($cns)& "Wait...!" &@CRLF)

_mischen()

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd

Func _mischen()
	$time = TimerInit()
	$anz = InputBox("Cards", "Wie viele?", "10")
	$KI = 0
While 1
	$Card = Random(1, 4, 1)
	$Num = Random(1, 13, 1)
	If $Card = 1 Then
		$Cardl = "Karo"
	Else
		If $Card = 2 Then
			$Cardl = "Pik"
		Else
			If $Card = 3 Then
				$Cardl = "Herz"
			Else
				$Cardl = "Kreuz"
			EndIf
		EndIf
	EndIf
	
	If $Num = 13 Then
		$Numl = "König"
	Else
		If $Num = 12 Then
			$Numl = "Dame"
		Else
			If $Num = 11 Then
				$Numl = "Bube"
			Else
				$Numl = $num
			EndIf
		EndIf
	EndIf
	
	$KI = $KI + 1
	
	TrayTip("Cards", "["&$KI&"]-["&Round(TimerDiff($time)/1000, 0)&"]", 99999999)
	
	GUICtrlSetData($cns, guictrlread($cns)& "["&$KI&"]"&"{"&$Cardl&"-"&$Numl&"}" &@CRLF)
	
	
	
	If $KI = $anz Then
		ExitLoop
		MsgBox(0, "Cards", "Fertig!")
	EndIf
	
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
EndFunc