安卓按键精灵_随机不重复任务

Call 随机任务()
Function 随机任务()
    Dim i=随机序列(0,5,",")
    TracePrint i
    dim MyString = Split(i, ",")
    for i = 0 To UBound(MyString) //取字符串长度
        TracePrint MyString(i )
        Dim rnd_num=CInt(MyString(i))
            Select Case rnd_num
        Case 0,1 
            TracePrint "纯文字"  
//             call 纯文动态()
        Case 2,3
            TracePrint "纯图片" 
//            Call 纯图动态()
        Case 3,4,5
            TracePrint "图片+文字" 
//            Call 图文动态()
        End Select  
    Next
End Function


Function 随机序列(k, i, f)
Dim d=""
Dim m=""
For i
m = m & k & ","
k=k+1
Next
m = UTF8.StrCut(m, len(m), 1)
For i
Dim arr=split(m,",")
Dim n=ubound(arr)
Dim s=int((n+1)*rnd())
If s = n Then
m = Replace(m, "," & arr(s), "")
ElseIf s = 0 Then
m = UTF8.StrCut(m,1,len(arr(s))+1)
Else
m=Replace(m, ","&arr(s)&",", ",")
End If
d = d & arr(s) & ","
Next
d = UTF8.StrCut(d, Len(d), 1)
随机序列 = Replace(d,",",f)
End Function

 

赞 (0)