# Enlightened, Part II: A Curious Courtyard

If you care about the story, you may want to see Part I if you haven't already. Otherwise, just enjoy the puzzle!

Ricky: Chris!
Chris: What is it this time?
Ricky: We have another problem.
Chris: Another problem? I can't solve all your problems, you know.
Ricky: But-
Chris: (sighing) Just say your problem.
Ricky: So we found the temple, and entered a large courtyard. The door to the temple, however, is locked, and seems to be resistant against the tools we have available.
Chris: How can I help?
Ricky: A careful reading of some text we found on a pillar in the courtyard says what we have to do. But I'm unable to do it. It seems to be some logic game - here, I'll explain it to you. (pulls out a roughly drawn diagram from his pocket)

Ricky: The courtyard is made up of a grid of square tiles. Each tile has a lantern embedded into it with four slits which let light escape facing up, down, left and right. These lanterns can be extended to provide light or retracted to produce no light. Whenever you choose to extend the lantern of a tile, light pours out of the four slits. We mark this light using a number - the lantern itself is 5 units bright, and every tile the light travels it loses a unit of light until it reaches zero. You can see this from the left diagram.
Ricky: However, the right diagram is more interesting. You see, when two or more paths of light intersect, their light values add. And if they hit a pillar or wall, the stream of light is blocked. It is also interesting that the lanterns themselves can be lit above five as the light from other lanterns passes through them.
Chris: This is all very well and good, but what's it got to do with opening the door?
Ricky: The courtyard of the temple has a puzzle in it that, once solved, will open the door. The courtyard has a ten by ten grid of tiles in it, each with a lantern embedded into it and a number written on it. We just need to extend the right lanterns so that the units of light for each square matches the number written on it.
Chris: That surely can't be so hard?
Ricky: You would think so. However, there is one problem that prevents us from solving this ancient puzzle... (trails off)
Chris: Which is?
Ricky: Maybe it's better to show you. (pulls out a diagram from his pocket)

Ricky: The tiles' numbers are written in an ancient language. We can't translate them. All we know is that one symbol maps to one number.
Chris: (rather desperate) Is there anything else you know?
Ricky: No. Wait - actually, there is. We know the following symbol - (points to the diagram)

Ricky: - means zero.
Chris: Well, this is certainly a challenge. But surely it can't be as bad as reconstructing that map!

Can you help Chris figure out which lanterns should be extended?

• I am also hardly able to solve all your puzzle problems ;) – user2408578 Apr 24 '15 at 7:31
• Seems like a great puzzle, can we take that symbol as 0, is that actually a hard fact? – Vincent Apr 24 '15 at 7:38
• @VincentAdvocaat Yes. I'll edit that to make it more clear. – Tryth Apr 24 '15 at 7:39
• O wow this is hard, i know of 1 symbol which must be a lamp and i know the places where lamps can at least not be, but i'm still so far from a solution. I'll get there, hopefully before someone else :P – Vincent Apr 24 '15 at 8:25

I got the solution ($O$'s for extended lanterns):

\begin{array}{ccc} . & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ A & X & O & X & O & X & X & X & X & X & X \\ B & O & X & X & X & X & X & X & X & X & O \\ C & X & X & \blacksquare & O & O & X & X & \blacksquare & X & X \\ D & X & O & X & \blacksquare & O & O & \blacksquare & X & X & X \\ E & X & X & O & X & X & X & O & X & X & X \\ F & X & X & X & X & X & X & X & X & X & O \\ G & X & X & O & \blacksquare & X & X & \blacksquare & O & X & O \\ H & X & X & \blacksquare & X & X & O & X & \blacksquare & X & X \\ I & X & X & O & X & O & X & X & X & X & X \\ J & O & X & X & X & X & X & X & X & X & X \\ \end{array}

I'll explain, in short, how I filled the grid:

• The first step is to put $X$'s at all tiles that would shed light on completely dark tiles (namely, ones with the number zero). For example, D7 and D9. Throughout the solution I put $X$'s at tiles which would shed too much light on particular tiles (without elaborating).

• The tiles G7 and G8 can be lit by three possible tiles - E7, G7 and G9 - and they get the same amount of light. The only option for extended lanterns is G7 and G9, making both tiles 8-bright. Now we know the symbol for 8 and we can replace it throughout the grid.

• The tile D9 gets 2 from the lantern at G9. The only way to get 6 more is to extend the lanterns at B9 and F9. Doing so, we get the symbol for 4 (at tile A9) and for 7 (at tile C9).

• Tile H9 is already 7-bright, so the lantern at I9 is not extended.

• E7 needs 4 more, so the lantern at E6 (and not the ones at E4 and E5) is extended. This gives us the symbol for 6.

• E6 needs 1 more, so the lantern at E2 is extended.

• F2 needs 4 more, so the lantern at G2 is extended.

• I9 gets 5 from the lanterns at F9 and G9, so its symbol can be either 5 or 6. But the symbol is different from the one we know for 6, so it's 5.

• H6 needs 4 more, so the lantern at H5 (and not the ones at H3 and H4) is extended.

• H5 needs 1 more, so the lantern at D5 is extended.

• A5 needs 4 more, so the lanterns at A1 and A3 are extended.

• B0 needs 5 more, so the lantern at B0 is extended.

• C1 needs 4 more, so the lantern at D1 is extended.

• J0 needs 5 more, so the lantern at J0 (and not the ones at H0, I0 and J1) is extended.

• I0 needs 4 more, so the lanterns at I2 and I4 (and not the one at I3) are extended.

• B4 needs 7 more, so the lanterns at C4 and D4 are extended.

• C6 needs 2 more, so the lantern at C3 is extended.

And we've filled the grid! Note that, to do so, we only had to find the symbols for 4, 5, 6, 7 and 8. Of course, now we can easily find all the others.

\begin{array}{ccc} & 10 & *10 & 8 & *11 & 11 & 6 & 2 & 1 & 0 & 4\\ & *5 & 11 & 3 & 10 & 8 & 4 & 2 & 3 & 4 & *6\\ & 4 & 7 & X & *12 & *13 & 11 & 5 & X & 0 & 7\\ & 7 & *7 & 10 & X & *13 & *10 & X & 2 & 0 & 8\\ & 5 & 9 & *9 & 6 & 15 & 12 & *6 & 7 & 3 & 11\\ & 2 & 3 & 8 & 0 & 7 & 7 & 6 & 7 & 4 & *10\\ & 5 & 6 & *8 & X & 6 & 6 & X & *8 & 8 & *12\\ & 3 & 1 & X & 3 & 9 &* 6 & 4 & X & 0 & 7\\& 8 & 6 & *8 & 8 & *8 & 10 & 4 & 2 & 1 & 5\\ & *5 & 4 & 7 & 2 & 5 & 3 & 0 & 0 & 0 & 3\\ \end{array}

Stars indicate the open lanterns

Started with the cell to the left of the zero on the top row - only one light can be incident on it if the other cell is to remain zero. That symbol must therefore be 1. The rest was number-crunching. I'm sure there was a better way to do it, though! (and a better way to represent the result)