Hello, i did a script that shuffle number from 0 to 7,
just need to know if it can be optimize
VB Code:
Randomize Dim rndArr(), tmp, isOk, x x = 0 ReDim rndArr(x) Do Until x = 8 tmp = CInt(Rnd() * 7) isOk = True For y = 0 To x - 1 If rndArr(y) = tmp Then isOk = False Exit For End If Next If isOk = True Then rndArr(x) = tmp x = x + 1 ReDim Preserve rndArr(x) End If Loop
