To provide some information to non-golfers I have two versions of my code in which I've included some explanation of the steps. This code is NOT eligable for golfing in the public round, it's just for informational purposes.

My 198 with explanation:
 Code:
; begin Linear Pachinko
;
;!
Function a($)
dim $c, $d, $h, $l, $x, $y

; Get the length for division.
$l = $^0

; Add a hole to the left and right.
$  = '.' + $ + '.'

; Put all relevant occurences in an array.
$x = _, '.', './', '\.', '.|.', '.|', '|.'

; Assign points for occurences in array $x (floor = 0, mountain side or 
; wall with two holes = 10, wall with single hole = 5). These will be 
;multiplied by 10 later to get 100% or 50%.
$y = 0, 10, 10, 10, 10, 5, 5

; Loop through array $x.
For $c = 0 to 6

	; Split on occurence. The ubound of the array is the number of occurences.
	$  = Split($,$x[$c])
	
	; Add the points to the total (occurences X value X 10).
	$h = $h + UBound($)*$y[$c]*10

	; Join $ again. On the first occurence (floor) it is replaced 
	; with nothing ($d = empty), because we don't need them. 
	$  = Join($,$d)

	; The rest of the occurences are replaced with a single hole.
	$d = '.'
	
	; Divide the total points (minus 200 because of the added left and right
	; holes) by the length of the original $.
	$a = ($h-200) / $l
	
EndFunction
;!
;!
; end Linear Pachinko


My 161 with explanation:
 Code:
; begin Linear Pachinko
;
;!
; I'm setting up an array of all possible occurences. I've
; put the length of the original string in an extra field,
; because that saves me a variable. The use of the other
; fields will be explained later.

; I'm looping from 3 to 9 because of the linear result in
; the calculation ($c/4). this will return the following
; range: 0, 1, 1, 1, 1, 2, 2. 

; In the first run I'm splitting on floor parts. they don't
; have any value (the calculation 100/($c/4) will result in
; 0 (see range above) and I don't want them back in the 
; string, so they will be replaced with an empty var ($h).
; When I've removed the floor parts, the only remaining
; possibilities are the ones that are in the array $o.

; The second run I'm splitting on holes. They always have a
; 100% value, so the calculation will be 100/1 and this is
; added to the total $s. Because the variable $h is now
; filled with an x, all the holes will be replaced with an x.

; the x-es in the split line represent the left and Right
; exits so they will be included in the next evaluations.

; The third to fifth fields in $o are 100% values so they
; are also added to the total. The sixth and seventh fields
; are 50% values, so the calculation results in 2 which gives
; 100/2 = 50.

; After each calculation of $s I generate a $a, but this is 
; just done because of shortness of code. Only after the
; seventh run is $s complete and will the calculation 
; $s / $o[7] ($o[7] being the original length of the string)
; result in the correct return value.
; This explains why I can do without the floor parts. After
; all, if it's not a 100% or a 50% hit, it must be a 0% hit
; (ie a floor part).

Function a($)
dim $c, $h, $s, $o

$o = _, '.', 'x/', '\x', 'x|x', 'x|', '|x', $^0

For $c = 3 to 9
	$  = Split(x+$+x, $o[$c-3])
	$s = $s + UBound($) * 100/($c/4)
	$a = $s / $o[7]
	$  = Join($, $h)
	$h = x
EndFunction
;!
;!
; end Linear Pachinko


Edited by DrillSergeant (2007-10-12 10:18 AM)
_________________________
The Code is out there