explanation: if $c is either / or \ $d can be only 0 or 1, so instead of multiplying with the value of $d we can also make it conditional and spare another ()...
; begin Linear Pachinko
;!
function a($b)
dim $c,$,$d
$=join(split($b,_),$)
while $
$d=$c<'/'
$c=$
$=right($,~)
$d=$d+($<'/')
$a=$a+2*($c<'/'|$c>'/'&$c<_&$d)+$d*($c>_)
loop
$a=$a*50/($b^)
endfunction
;!
;!
; end Linear Pachinko
result:
Running Test 1...Done 61
Running Test 2...Done 53
Running Test 3...Done 100
Running Test 4...Done 0
Running Test 5...Done 100
Running Test 6...Done 50
Running Test 7...Done 53
Running Test 8...Done 10
Running Test 9...Done 0
Running Test 10...Done 38
Your solution passed all tests
Your solution passed all tests
KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_lp.kix
KiXGolf Scoring Engine
Scoring Engine = 3.3
KiXtart Golf Score
Tournament = Linear Pachinko
Processing Start = 2007/10/15 22:00:33.170
Processing End = 2007/10/15 22:00:33.170
Duration = 0000/00/00 00:00:00.000
KiXGolf Score = 158
Thank you for participating in KiXtart Golf!