Illuminate a Mirrored Room Goal

In this competition, you are given a random room with one candle inside. The goal is to write the shortest program (this is golf) that determines what parts of the room are illuminated by the candle, by replacing the dark spots with @'s. The program should take a room from STDIN, with the output printed to STDOUT.

Example Input/Room

+------+
|  C   |
|      +--+
|  \      |
+---------+


The candle is represented with a C, and the walls/mirrors are represented with |,-,/, or \. The walls themselves are mirrors. The corners of the room are represented with a +.

Rooms will never have diagonal walls, and light will never be able to escape out of the room. 

Also, the first character on a line is always going to be part of the wall off the room. The absolute last character on each line is going to be the opposite wall of the room. No characters between these two are going to be outside of the room.

Light and Reflection

The candle emits eight (laser-like) beams of light in eight basic directions: N, S, E, W, NE, SE, SW, and NW. These rays of light bounce off of the mirrors as described below:

Old Direction of Travel | Mirror | New Direction
N S E W NE SE SW NW       /        E W N S -- -- -- --
N S E W NE SE SW NW       \        W E S N -- -- -- --
N S E W NE SE SW NW       |        - - - - NW SW NE SW
N S E W NE SE SW NW       -        - - - - SE NE SW NE


A - represents the light being absorbed. Light is always absorbed by C's or +'s.  It is important to note that the lights reflects off of a mirror only when it is occupying the same space as the mirror. These rules are much easier to understand when you draw the reflection out on paper.

Example Output

As output, the program should print an image of the illuminated room, with dark spots written as an @, light spots left blank, and mirrors unaffected. For the above example, the output would be:

+------+
|  C   |
|@   @ +--+
| @\      |
+---------+


This means that, if you drew out the beams of light, they will never reach the spaces marked with @.

More examples

Input:
+-----+
|     |
|     |
|  C  |
|     |
|     |
+-----+
Output:
+-----+
| @ @ |
|@   @|
|  C  |
|@   @|
| @ @ |
+-----+

Input:
+-----+
|  \  |
|/ C \+-+
|       |
|  \ - ++
+------+
Output:
+-----+
|  \ @|
|/ C \+-+
|      @|
| @\ -@++
+------+
Python, 292 chars

import sys
R=''
for x in sys.stdin:R+='%-97s\n'%x[:-1].replace(' ','@')
M={'/':'-98/d','\\':'98/d'}
for d in(-98,-1,1,98,99,97,-97,-99):
 if d&gt;98:M={'|':'d^2','-':'-d^2'}
 p=R.find('C')
 while 1:
  p+=d
  if R[p]in' @':R=R[:p]+' '+R[p+1:]
  elif R[p]in M:d=eval(M[R[p]])
  else:break
print R,


Reads in the room, makes it rectangular, then walks out from the candle in all directions.  M contains the active mirror characters and their effect (/\ for the cardinal directions, |- for the others)

Can handle rooms up to 97 characters wide.