This is the super-fast one I was working on ... its basically the kixtart interpretation of the Burrows-Wheeler algorithm described in their original paper ... its fast because there is no need for a sort (score=267):

code:
function bwtdecode($s, $x)

dim $,$j,$k,$n

$n = len($s)-1

dim $t[$n],$l[$n],$c[255]

for $ = 0 to $n
$l[$] = asc(substr($s,$+1,1))
$j = $l[$]
$t[$] = $c[$j]
$c[$j] = $c[$j] + 1
next

for $ = 0 to 126
$k = $k + $c[$]
$c[$] = $k - $c[$]
next

for $ = 0 to $n
$x = $t[$x] + $c[$l[$x]]
$bwtdecode = chr($l[$x]) + $bwtdecode
next

endfunction

Again ... well done Howard and you too Patrick and m...

-Shawn

[ 29. December 2002, 22:22: Message edited by: Shawn ]