一切为了随机数
设定一个随机数站位 最小值和最大值
For $i = 0 To 10
Local $data = _random_number(5, 10)
ConsoleWrite($data & @CRLF)
Next
Func _random_number($minimum = 2, $maximum = 8)
Local $random_number
Local $data = 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,,a,b,c,d,e,f,g,h,i' & _
'j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9,0,~,!,@,#,$,%,^,&,*'
Local $data_arr = StringSplit($data, ',')
If $maximum > UBound($data_arr) - 1 Then $maximum = UBound($data_arr) - 1
If $maximum < 1 Then $maximum = 8
If $minimum < 1 Then $minimum = 2
If $minimum > $maximum Then $minimum = $maximum
Local $num = Random($minimum, $maximum, 1)
For $n = 1 To $num
$random_number &= $data_arr[Random(1, UBound($data_arr) - 1, 1)]
Next
Return $random_number
EndFunc
|