# The temple of tourists and tables

11 tourists are standing in an ancient temple (6x6 grid).
The temple contains 16 stone tables.
Each tourist is facing either north, south, west, or east and sees a different number of tables.
The numbers in the grid indicate where each tourist is standing and how many tables they see.
Each cell holds either a tourist, a table, or nothing (no overlaps).
A tourist can see anything in front of them at 45 degree angles. Tables and tourists do not block lines of sight.

For example, in this hypothetical temple (with 6 tables marked "T"), the tourist numbered "4" is facing north and can see 4 tables. Yellow squares are in their line of sight.

Here is the actual temple. Where are the 16 tables located?

Text version:

Example:
y y T 1 T y
T y T y y -
- 3 y y - -
- T 4 - - -
- - - T - -
- - - - - -

Puzzle:
- - 2 - - 9
- - - 0 - -
7 5 - 3 - 10
- - - - 4 -
- 6 - 1 - -
- - 8 - - -


This is way I solved it; there may well be a shorter and/or more elegant solution.

If 0 faces E then 2 must face W. Thus, among the sixteen still-empty squares in

there are fourteen with tables. Then 4 must be facing S, and 1 too. So among the eleven still-empty squares in

there are ten with tables. But then there's no direction 5 can face. So 0 doesn't face E, and must therefore face N. So we have

Now, 8 faces N, so there must be eight tables south of 8's line of sight, which means (because 1 can only see one of them) that we have

If 7 is facing E there's not enough room west of 7's line of sight for nine more tables, so 7 is facing S. Thus,

Now, 10 must be facing W, so

We need four more tables, so 5 can't be facing N, so 5 is facing E, and

And thus

Let's make sure all the numbers work:

0 faces N, 1 S, 2 E, 3 E, 4 S, 5 E, 6 N, 7 S, 8 N, 9 S, and 10 W: yep, it works.

• This is great! I think my solution was a bit shorter so I'll write that up too Commented Oct 25, 2023 at 18:40

The solution is

T T 2 Y Y 9
T T Y 0 Y T
7 5 Y 3 Y 10
T T Y Y 4 T
T 6 T 1 T T
T T 8 T Y T

Here is my approach:

We start off with the puzzle
- - 2 - - 9
- - - 0 - -
7 5 - 3 - 10
- - - - 4 -
- 6 - 1 - -
- - 8 - - -

7 must be S (E would not provide enough T for the grid).
- - 2 - - 9
- - - 0 - -
7 5 - 3 - 10
T T - - 4 -
T 6 T 1 - -
T T 8 T - -

This forces 1S and 0N
- - 2 Y Y 9
- - - 0 - -
7 5 - 3 - 10
T T - - 4 -
T 6 T 1 - -
T T 8 T Y -

If we consider 10W, there are 8 positions not seen by 10 and 6T not seen by 10. 2 positions have Y, so the rest must be T
- - 2 Y Y 9
- - - 0 - T
7 5 - 3 - 10
T T - - 4 T
T 6 T 1 T T
T T 8 T Y T

2E and 5E place the rest of the Y
- - 2 Y Y 9
- - Y 0 Y T
7 5 Y 3 Y 10
T T Y Y 4 T
T 6 T 1 T T
T T 8 T Y T

Then we can fill in the rest of the T
T T 2 Y Y 9
T T Y 0 Y T
7 5 Y 3 Y 10
T T Y Y 4 T
T 6 T 1 T T
T T 8 T Y T