Calculate the total number of paths Description

There will be a grid of 9x9, where there will be placed 12 rocks.

You will start at a starting-rock and walking with a starting-direction (north, south, west or east), whenever you see a rock, you have two options:


Climb over the rock and continue in the same direction
Change direction to your *left


*NOT to the west, you change to your left as if you were walking and you take your own left.

So the flow of the paths will always be counter-clockwise. Here is an example that illustrates the flow:



Note: In this case, the starting-rock is the yellow (X) and the starting-direction is to the south



Rules


The code must be able to solve it for any rock (if it doesn't have complete paths, then is 0)
You can NOT memorize anything different than the rocks used
The rocks must be included on the code (so you can't pass them by input)
We will use the above's rock placement in the competition
You chose how you will pick the starting-rock (Example: passing an
array index or giving a xy location, etc) and how you chose the starting-direction (Example: 1=north, 2=south or etc)
It must return, print or otherwise make us know the total number of
paths somehow for that given rock
Counted by characters used


Just to immortalize the grid and rock placements in case the image dies for unknown reasons, I will put it in plain text:

100100000
100100010
000000000
000000000
000000000
010010000
000000000
010100000
100010010

//rocks = 1, empty = 0




Clarifications


You can't walk on the same part twice on the same path (crossing ways are allowed)
We need to be able to set on the input: a) the starting-rock and b)
the starting-direction
The complete paths must end on the starting-rock
Note that it shouldn't be a problem whether we can climb over a starting rock or not, because it is impossible to this to happen with the current map and rules (we do have a four-path rock where this could happen, but after analysing it, this can't happen)
You are allowed to compress the 9x9 grid. (the most it can be compressed is to a 5x5 I think)
Python, 274 chars

S=7
D=-1j

R=[0,4,7,1+1j,3+1j,1+3j,4+3j,7j,3+7j,7+7j,8j,3+8j]
Z={}
for i in range(4096):
 d=D;p=R[S];L=[]
 while len(L)&lt;12:
  p+=d;P=[(abs(r-p),r)for r in R if r-p==abs(r-p)*d]
  if not P:break
  p=min(P)[1];d*=1j**(i&gt;&gt;R.index(p)&amp;1);L+=[p]
  if p==R[S]:Z[tuple(L)]=1;break
print len(Z)


The code I'm counting starts at the R=[..., the initial two lines are "input" which I didn't count.

R is the set of rock coordinates, listed using complex number coordinates.  S is the starting rock.  D is the starting direction, again using complex numbers (1=right,-1=left,1j=up,-1j=down).

The code tries all of the 2^12=4096 possibilities for go straight/turn left for each rock, then walks from the starting rock until it gets back to the starting rock, or there is no more rock on the path, or the path gets too long (it loops).  It saves the path in Z if it is successful.