Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
function randint(n)
|
||||
{
|
||||
return int(n * rand())
|
||||
}
|
||||
|
||||
function sorted(sa, sn)
|
||||
{
|
||||
for(si=1; si < sn; si++) {
|
||||
if ( sa[si] > sa[si+1] ) return 0;
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
{
|
||||
line[NR] = $0
|
||||
}
|
||||
END { # sort it with bogo sort
|
||||
while ( sorted(line, NR) == 0 ) {
|
||||
for(i=1; i <= NR; i++) {
|
||||
r = randint(NR) + 1
|
||||
t = line[i]
|
||||
line[i] = line[r]
|
||||
line[r] = t
|
||||
}
|
||||
}
|
||||
#print it
|
||||
for(i=1; i <= NR; i++) {
|
||||
print line[i]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue