Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,30 +0,0 @@
|
|||
sub swap( byref a, byref b )
|
||||
dim tmp
|
||||
tmp = a
|
||||
a = b
|
||||
b = tmp
|
||||
end sub
|
||||
|
||||
'knuth shuffle (I think)
|
||||
function shuffle( a )
|
||||
dim i
|
||||
dim r
|
||||
randomize timer
|
||||
for i = lbound( a ) to ubound( a )
|
||||
r = int( rnd * ( ubound( a ) + 1 ) )
|
||||
if r <> i then
|
||||
swap a(i), a(r)
|
||||
end if
|
||||
next
|
||||
shuffle = a
|
||||
end function
|
||||
|
||||
function inOrder( a )
|
||||
dim res
|
||||
dim i
|
||||
for i = 0 to ubound( a ) - 1
|
||||
res = ( a(i) <= a(i+1) )
|
||||
if res = false then exit for
|
||||
next
|
||||
inOrder = res
|
||||
end function
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
dim a
|
||||
a = array(11, 1, 2, 3, 4, 4, 6, 7, 8)
|
||||
|
||||
dim t
|
||||
t = timer
|
||||
while not inorder( a )
|
||||
shuffle a
|
||||
wend
|
||||
wscript.echo timer-t, "seconds"
|
||||
wscript.echo join( a, ", " )
|
||||
Loading…
Add table
Add a link
Reference in a new issue