Imagine you have a grid where some squares are walls, some are empty, and some are lights that shine for arbitrary distances in the four cardinal directions until they meet walls:
####.####
##..L....
####.##.#
####.##L.
##......L
In the above grid, the lights cover all the tiles. But in some cases, they may not be:
###
.#L
###
Your challenge is, given a grid like the one above, determine whether all empty tiles are lit up. You may take input as a matrix of characters or integers, a list of lines, newline-separated lines (as above) with any three distinct characters, etc.
An input may contain none of a type of cell.
You may output truthy and falsy with any of the following:
- Values your language considers truthy or falsy (if applicable), or inverted
- One truthy value and everything else is falsy, or vice versa
- Two consistent values representing truthy and falsy
Testcases (Given in above format)
Truthy:
L
L.
.L
L....
..#L.
....L
.L...
#
L...L...L
#####.###
#L...L...
##.####L.
#.L..####
Falsey:
.
.#
L#.
.#.
.L.
.#.
L...
L...
L.#.
L...
L.
..