The challenge
The shortest code by character count to input a 2D representation of a board, and output 'true' or 'false' according to the input.
The board is made out of 4 types of tiles:
# - A solid wall
x - The target the laser has to hit
/ or \ - Mirrors pointing to a direction (depends on laser direction)
v, ^, > or < - The laser pointing to a direction (down, up, right and left respectively)
There is only one laser and only one target. Walls must form a solid rectangle of any size, where the laser and target are placed inside. Walls inside the 'room' are possible.
Laser ray shots and travels from its origin to the direction it's pointing. If a laser ray hits the wall, it stops. If a laser ray hits a mirror, it bounces 90 degrees to the direction the mirror points to. Mirrors are two sided, meaning both sides are 'reflective' and may bounce a ray in two ways. If a laser ray hits the laser (^v><) itself, it is treated as a wall (laser beam destroys the beamer and so it'll never hit the target).
Test cases
Input:
##########
# / \ #
# #
# \ x#
# > / #
##########
Output:
true
Input:
##########
# v x #
# / #
# /#
# \ #
##########
Output:
false
Input:
#############
# # #
# > # #
# # #
# # x #
# # #
#############
Output:
false
Input:
##########
#/\/\/\ #
#\\//\\\ #
#//\/\/\\#
#\/\/\/x^#
##########
Output:
true
Code count includes input/output (i.e full program).