Code:
KiXtart
KiXtart Version = 4.23
KiXGolf Script = kixgolf_bta.kix

Computer
OS = Windows XP Home Edition
CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz
Speed = 2793 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Balanced Terniary Addition
Processing Start = 2005/02/23 16:17:20.218
Processing End = 2005/02/23 16:17:49.625
Duration = 0000/00/00 00:00:29.406
# Tests Run = 106
# Tests Passed = 106
# Tests Failed = 0
Result = passed
KiXGolf Score = 176

Thank you for participating in KiXtart Golf!


Code:

function bta($b, $c)
dim $,$x
if $c
for $=-729 to -$
$x=$x+$*($b=bta($,0))+$*($c=bta($,0))
next
$bta=bta($x,0)
else
do
$c = $b mod 3
$ = $c/-2
$bta = "" + ($c + 3*$) + $bta
$b = ($b-$) / 3
until $b=0
endif
endfunction

_________________________
!

download KiXnet