Gawd!

missing the obvious

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_ts.kix

Computer
OS = Windows 2000 Professional
CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz
Speed = 2793 MHz
Memory = 504 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Top Secret
Processing Start = 2007/08/10 10:19:20.234
Processing End = 2007/08/10 10:19:20.281
Duration = 0000/00/00 00:00:00.047
KiXGolf Score = 423

Thank you for participating in KiXtart Golf!


function a($b, $c, $i, $d)
while $i
dim $, $e, $f, $g, $h, $j, $k, $n
for $ = 1 to $i^0
if $f < $b
$j = substr($i,$,1)
$e = lcase($j)
if $e<'a' | $e>'z'
$g = 1 + $g
$h = ',' + $h + $ + ','
else
$f = 1 + $f
$n = split(join($n) + ' ' + $j)
endif
endif
next
$e = left($i,$f+$g)
$i = right($i,-$f-$g)
for each $ in split($c,",")
if 0+$ <= $f
$k = split(join($k) + ' ' + $)
endif
next
for $g = 1 to $e^0
if instr($h,','+$g+',')
$a = $a + substr($e,$g,1)
$j = 1 + $j
else
$ = 1 + $
if $d = E
$a = $a + $n[$k[$]]
else
$a = $a + $n[ascan($k,$g-$j)]
endfunction
_________________________