相关代码 |
|
function getrandom( n) randomize timer getrandom=Int(n*Rnd(timer)+1) end function %> dim sel dim num dim total,length,i,j,cur dim ar(),arnew() redim ar(100) redim arnew(100) num=8 total=20 length=total for i=1 to 20 ar(i)=i next i=1 do while(length>1 and num>0) cur=getrandom(length) arnew(i)=ar(cur) for j=cur to length-1 ar(j)=ar(j+1) next num=num-1 length=length-1 i=i+1 loop %> erase ar erase arnew %>
相关资源 |
|