it took long time but here it goes:
code:
function CDSorter($s, $m)
Dim $x, $, $b
do
$b = split($s,",")
do
$=0.
Dim $z,$q
for each $x in $b
$q=1+$q
if $x
$ = $ + $x
$z=$z+","+$q
endif
next
$b[RND($q-2)]=0
$CDSorter=substr($z,2)
until $ < $m
until $ > $m-1
endfunction

quote:

Average CD Length = 44.38
Average Gap = 0.62
Average Gap [%] = 1.37

KiXtart
KiXtart Version = 4.21 Release Candidate 1
KiXGolf Script = kixgolf_cd.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 375 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: CD Sorter
Processing Start = 2003/03/16 17:25:42.282
Processing End = 2003/03/16 17:25:46.838
Duration = 0000/00/00 00:00:04.556
# Loops = 1
# Processed CDs = 12
# Valid CDs = 12
# Full CDs = 0
KiXGolf Result = Valid CD Filling
KiXGolf Score = 184

Thank you for participating in KiXtart Golf!

_________________________
!

download KiXnet