My perfect 183 should handle anything.

code:
function CDSorter($w, $)
Dim $x, $b
do
$x = split($w,",")
do
$b=0.
Dim $z,$q,$
for each $q in $x
$=1+$
if $q
$b = $b + $q
$z=$z+","+$
endif
next
$x[RND($-1)]=0
$CDSorter=substr($z,2)
until $b<=$
until $b > $-1
endfunction

code:
Average CD Length = 44.45
Average Gap = 0.55
Average Gap [%] = 1.21

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

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz
Memory = 511 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: CD Sorter
Processing Start = 2003/03/17 16:19:11.216
Processing End = 2003/03/17 16:19:48.775
Duration = 0000/00/00 00:00:37.559
# Loops = 1
# Processed CDs = 13
# Valid CDs = 13
# Full CDs = 0
KiXGolf Result = Valid CD Filling
KiXGolf Score = 183

Thank you for participating in KiXtart Golf



[ 17. March 2003, 22:19: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/