Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -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

View file

@ -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, ", " )