KiXGolf Score = 255
 Code:
function a($s, optional $k,$,$c,$e,$p,$z)
  $z=1,128,64,32,16,8,4,2,1
  For $c=1 To ($s^)
    $p=substr($s,$c,1)
    if $k
      ;Encode
      For $=1 to 8
        $a=$a+iif(asc($p) & $z[$], iif($k=" "," "," "), $k)
      Next
    else
      ;Decode
      $=$c mod 8
      $e=$z[$]*(right($s,1)<>$p)+$e
      if $=0
        $a=$a+chr($e)
        $e=0
      endif
    endif
  Next
  $a=$a+$k
endfunction
 


Edited by Howard Bullock (2011-11-13 07:02 PM)
_________________________
Home page: http://www.kixhelp.com/hb/