#include <array.au3>
Dim $a[313], $b[2], $c[1]
;建立数组
For $i = 0 To 5
For $j = 1 To 52
$a[$i * 52 + $j] = $j
Next
Next
Do
_ArrayDelete($a,Random(1, UBound($a - 1), 1));随机删除一个元素
For $k = 0 To 1 ;随机抽取2个元素
$t = Random(1, UBound($a) - 1)
$b[$k] = $a[$t]
_ArrayDelete($a,$t)
Next
bj()
Until UBound($a) = 1
Func bj();进行比较
Select
Case $b[0]>$b[1]
_ArrayAdd($c,"大")
Case $b[0]<$b[1]
_ArrayAdd($c,"小")
Case $b[0]=$b[1]
_ArrayAdd($c,"和")
EndSelect
EndFunc ;==>bj
;_ArrayDisplay($c)
;输出结果
_ArrayAdd($c,"")
For $i=1 To 7
For $j=0 To 14
ConsoleWrite($c[$i+$j*7])
ConsoleWrite(" ")
Next
ConsoleWrite(@CRLF)
Next
|