Global $card[13]=["2","3","4","5","6","7","8","9","10","J","Q","K","A"],$color[4]=["黑","红","花","片"]
Dim $howmany=6
Global $all[52*$howmany]
$t=0
For $a=1 To $howmany
For $b=0 To UBound($color)-1
For $c=0 To UBound($card)-1
$all[$t]=$color[$b]&$card[$c]
$t+=1
Next
Next
Next
_Display()
$t=Random(1000,9999)
For $a=1 To $t
$b=Random(0,UBound($all)-1)
$c=Random(0,UBound($all)-1)
If $b<>$c Then
$str=$all[$b]
$all[$b]=$all[$c]
$all[$c]=$str
EndIf
Next
_Display()
Func _Display()
$str=""
For $a=0 To UBound($all)-1
$str&=$all[$a]&" "
If Mod($a,UBound($card))=UBound($card)-1 Then $str&=@CRLF
Next
ConsoleWrite($str&@CRLF)
EndFunc
小区域随机变换,不知道结果是不是楼主想要的 |