House of Mirrors House of Mirrors
Undefined
English

This mission is an adaptation of the "Undead" game (from Simon Tatham's Portable Puzzle Collection). If you are lost or just want to play, the game is available here.

There is a house of mirrors filled with monsters (ghosts, vampires and zombies). Inside, the mirrors are arranged to show what's on the right or left (so you can't see yourself).
As you probably know,

  • ghosts are not visible except through a mirror,
  • vampires have no reflection,
  • zombies are always visible.

You will have to fill in the plan of the house with these monsters. For this, we give you the plan, the number of ghosts/vampires/zombies and the number of monsters that can be seen from outside.

The rectangular house will be represented by a tuple of strings. Empty places by '.', mirrors by '\\' and '/', ghosts by 'G', vampires by 'V', zombies by 'Z'. Elements are separated by spaces (input and output).

Input: A tuple of strings, a dictionary (keys: 'ghost', 'vampire', 'zombie' ; values: integers) and a dictionary (keys: 'N', 'S', 'W', 'E' which stand for North, South, West, East ; values: lists of integers).

Output: A tuple/list/iterable of strings.

Example:

4x4 example image

2 ghosts, 2 vampires, 4 zombies
('. \ . /',                 ('Z \ V /',
 '\ . . .',       ===\       '\ Z G V',
 '/ \ . \',       ===/       '/ \ Z \',
 '. \ / .')                  'G \ / Z')

For example, looking at column 2 from the north, you see monsters at (0, 2), (1, 2),
(2, 2) and (3, 0). The first three directly, the last one through mirrors.

Looking at column 2 from the north in the solution, you see them all
except the ghost at (1, 2), so three monsters as expected.
checkio(('. \\ . /',
         '\\ . . .',
         '/ \\ . \\',
         '. \\ / .'),
        {'ghost': 2,
         'vampire': 2,
         'zombie': 4},
        {'N': [3, 0, 3, 0],
         'S': [2, 1, 1, 4],
         'W': [4, 0, 0, 0],
         'E': [0, 3, 0, 1]}) == ('Z \\ V /',
                                 '\\ Z G V',
                                 '/ \\ Z \\',
                                 'G \\ / Z')

To play the puzzles / tests yourself: 1 2 3 4 5 6 7 8 9 10 11 12 13

Preconditions:

  • All puzzles have an unique solution.
  • 4 ≤ len(grid) ≤ 7 and 4 ≤ len(grid[0]) ≤ 7.
  • all(len(row) == len(grid[0]) for row in grid).