Here's a puzzle

puzzle
This puzzle consists of a rectangular grid with horizontal and vertical arrows.

and some clues

  1. Actress who played Betty in a festively titled comedy film (based on a play named after a beverage).

  2. Alternative rock album released in 2008 that was livestreamed in January 2021, with the recording being released under another name (often used to describe those whose power is superficial).

  3. Celebrated footballer with a body part located at ///those.bitters.landed.

  4. Children's author whose 1957 book features a green creature who steals Christmas gifts and decorations.

  5. Engineer who won a prestigious award in the 1950s, a few years after Kermit and Orville.

  6. European country where a special "Christmas juice" dominates December's soft-drink sales.

  7. Former Le Mans coach who represented France in Switzerland, a few days before turning 24.

  8. German city whose mayor has the same surname and first initial as a famous mathematician.

  9. K-pop song with nearly 1.8 billion views on YouTube, from a group whose name combines $$(0, 0, 0)$$ and $$(255, 192, 203)$$.

  10. Mid-80s computer game whose inlay card features a rhyme of ten lines ending with the following words: take, make, dare, lair, will, fill, fast, past, slow, go.

  11. Mythical apprentice rumoured to have broken a textile apparatus in the late 18th century.

  12. Norwegian ice hockey defender who executed a stick-breaking tackle in May 2021.

  13. Pop song whose video features the singer drawing a heart on a steamed-up mirror, touching a light-blue phone, and standing on the surface of a swimming pool.

  14. Three-syllable song title that links Lennon, Duffy, and Milburn.

  15. Title shared by a Canadian mockumentary and an episode of Star Trek: Discovery.

  16. UK city whose high street features an 8ft bronze statue of a cartoon character (plus his sidekick).

  17. Widely derided film starring JT (RF), GA (RS), and BA (IB).

Who's left over?

You may have noticed the remarkable property that each of the seventeen answers is constructed only from the eight "directional" letters N, S, E, W, U, D, R and L — that is, the four points of the compass and the four keyboard directions — once punctuation are removed. In order, the seventeen answers are as follows:

  1. Ellen Drew1 — who played Betty Casey in Christmas in July2, based on Preston Sturge's 1931 play A Cup of Coffee.

  2. New Surrender3 — name of the 2008 album by Anberlin4 performed via livestream in 2021, and released as Paper Tigers5.

  3. Uwe Seeler6 — whose right foot7 (or rather, a large statue thereof) is located at the what3words-address8 indicated.

  4. Dr. Seuss9 — author of How the Grinch Stole Christmas!10.

  5. Wendell E. Reed11 — winner of the 1995 Wright Brothers Medal12, a few years after Kermit Van Every (1948) and Orville Albert Wheelon (1951).

  6. Sweden13 — home of the popular Christmas soft-drink Julmust14.

  7. Rene Dereuddre15 — manager of Le Mans FC between 1964 and 1976, and a member of the France team16 competing at the 1954 FIFA Word Cup in Switzerland.

  8. Dresden17 — whose mayor Dirk Hilbert18 has the same surname and first initial as the mathematician David Hilbert19.

  9. Ddu-Du Ddu-Du20 — popular K-pop song from the group Blackpink21, with the triples of numbers in the clue representing colour codes for black22 and pink23 respectively.

  10. Underwurlde24 — with the specific rhyme appearing on the inlay card25 underneath the word BEWARE.

  11. Ned Ludd26 — person from whom the Luddites27 supposedly took their name.

  12. Erlend Lesund28 — whose tackle29 on Rodrigo Abos in May 2021 snapped the Latvian's stick.

  13. New Rules30 — with singer Dua Lipa31 performing the specified actions at approximately 0:37, 0:51 and 2:30 in the video32.

  14. Well Well Well — which is track 833 on John Lennon/Plastic Ono Band by John Lennon, track 434 (and lead single) on Endlessly by Duffy and track 135 on the eponymous debut album by Sheffield (UK) band Milburn.

  15. New Eden — title of the mockumentary36 created by Evany Rosen and Kayla Loretta, and the title of Season 2, Episode 237 of Star Trek: Discovery.

  16. Dundee38 — whose high street features a large bronze statue of Desperate Dan and his sidekick Dawg39, with Minnie the Minx lurking nearby.

  17. Runner Runner40 — featuring Justin Timberlake as Richie Furst, Gemma Arterton as Rebecca Shafran, and Ben Affleck as Ivan Block.

Each of these answers is written wordsearch-style somewhere within the grid provided, under the natural convention that an upward-pointing arrow represents N (North) or U (Up), a downward-pointing arrow represents S (South) or D (Down), a rightward-pointing arrow represents E (East) or R (Right), and a leftward-pointing arrow represents W (West) or L (Left). In keeping with the NSEWUDRL-theme, each answer is written horizontally or vertically (either forwards or backwards), rather than diagonally. The "completed" grid with all seventeen answers inserted is shown below, with orange shading added as a visual aid to highlight answers that are written backwards (i.e., right-to-left for a horizontal answer, or bottom-to-top for a vertical answer), and a green shading used for answers written in the usual direction (i.e., left-to-right or top-to-bottom).

solution
The entire grid is covered by the seventeen answers that are made up of the eight "directional" letters, except for the sixteen cells colored dark grey. The arrows on these remaining cells can readily be seen to encode the name RUSSELL WERNER LEE, the American photographer and photojournalist.

As shown above, the entire grid is covered by the seventeen answers, except for the sixteen cells colored dark grey. The arrows on these remaining cells can readily be seen to encode the name RUSSELL WERNER LEE41, the American photographer and photojournalist.

Finally, USELESS RULES is an apt puzzle title not just because it uses only the letters N, S, E, W, U, D, R and L as per all of the answers, but because the puzzle instructions are not particularly helpful!

Assignment

A puzzle grid is described in a text file with a rectangular $$m \times n$$ grid of arrows. The file consists of $$m$$ lines that each contain $$n$$ arrows: , , and . This is, for example, the content of a file with the puzzle grid from the introduction.

→↓→→↓↓→↑↓↓↑→↓→↓↓
↓↓↓↑←↓→↑→↑↓↓→←←↓
←→↑→↓→←→↑↓←→↓→↑↑
→→↑→↑↑↑→→→↑↑↑→→↓
↑←→→→↓↑→→→↑↓←→↑↑
←→←↓↑↑↓→→←→→↑→→↓
→→→←→↑↓→←←→→→→↓↓
→↓↑←→←←←→←←←→←←↑
↓→←↓↑↑↓→←↓↑→←→→↓
↑←→→←←→↑↓→→←←→→↑
↑↑↓→→↓↓↑→→→↓→↑→→

Tip

A text file containing a puzzle grid uses the UTF-8 character encoding. This is now the default encoding on most computer systems (including Dodona). If you encounter problems while reading files, you can explicitly specify the encoding when opening the files: encoding='utf-8'.

The rows of the grid are numbered from top to bottom and the columns from left to right, starting from zero. As such, a position in the grid can be represented as a tuple $$(r, c)$$ with $$r$$ ($$0 \leq r < m$$) the row number and $$c$$ ($$0 \leq c < n$$) the column number.

The four possible reading directions are also represented by the same arrows (str; in parentheses) that appear in the grid: horizontal from left to right (), horizontal from right to left (), vertical from top to bottom () and vertical from bottom to top ().

Define a class Puzzle that can be used to represent puzzles with a given puzzle grid, in which words can be put that coincide horizontally or vertically (forwards or backwards) with the arrows in the grid. The location (str) of a text file containing the puzzle grid must be passed when creating a puzzle (Puzzle).

If a puzzle $$p$$ (Puzzle) is passed to the built-in function str, it must return a string representation (str) taking the same form as the content of the text file that was passed when puzzle $$p$$ was created. However, the letters of all words that have already been put into the grid of puzzle $$p$$ must replace the arrows at the corresponding positions.

In addition, a puzzle $$p$$ (Puzzle) must support at least the following methods:

Example

In the following interactive session, we assume the current directory contains the text file grid.txt42.

>>> puzzle = Puzzle('grid.txt43')
>>> print(puzzle)
→↓→→↓↓→↑↓↓↑→↓→↓↓
↓↓↓↑←↓→↑→↑↓↓→←←↓
←→↑→↓→←→↑↓←→↓→↑↑
→→↑→↑↑↑→→→↑↑↑→→↓
↑←→→→↓↑→→→↑↓←→↑↑
←→←↓↑↑↓→→←→→↑→→↓
→→→←→↑↓→←←→→→→↓↓
→↓↑←→←←←→←←←→←←↑
↓→←↓↑↑↓→←↓↑→←→→↓
↑←→→←←→↑↓→→←←→→↑
↑↑↓→→↓↓↑→→→↓→↑→→
>>> puzzle.normalize('Wendell E. Reed')
'WENDELLEREED'
>>> puzzle.arrows('Wendell E. Reed')
'←→↑↓→←←→→→→↓'
>>> puzzle.isvalid('Wendell E. Reed', row=6, col=3, direction='→')
True
>>> puzzle.positions('Wendell E. Reed')
{(6, 3, '→')}
>>> print(puzzle.put('Wendell E. Reed', row=6, col=3, direction='→'))
→↓→→↓↓→↑↓↓↑→↓→↓↓
↓↓↓↑←↓→↑→↑↓↓→←←↓
←→↑→↓→←→↑↓←→↓→↑↑
→→↑→↑↑↑→→→↑↑↑→→↓
↑←→→→↓↑→→→↑↓←→↑↑
←→←↓↑↑↓→→←→→↑→→↓
→→→WENDELLEREED↓
→↓↑←→←←←→←←←→←←↑
↓→←↓↑↑↓→←↓↑→←→→↓
↑←→→←←→↑↓→→←←→→↑
↑↑↓→→↓↓↑→→→↓→↑→→
>>> puzzle.normalize('René Dereuddre')
'RENEDEREUDDRE'
>>> puzzle.arrows('René Dereuddre')
'→→↑→↓→→→↑↓↓→→'
>>> puzzle.isvalid('René Dereuddre', row=10, col=15, direction='←')
True
>>> puzzle.positions('René Dereuddre')
{(10, 15, '←')}
>>> print(puzzle.put('René Dereuddre', row=10, col=15, direction='←'))
→↓→→↓↓→↑↓↓↑→↓→↓↓
↓↓↓↑←↓→↑→↑↓↓→←←↓
←→↑→↓→←→↑↓←→↓→↑↑
→→↑→↑↑↑→→→↑↑↑→→↓
↑←→→→↓↑→→→↑↓←→↑↑
←→←↓↑↑↓→→←→→↑→→↓
→→→WENDELLEREED↓
→↓↑←→←←←→←←←→←←↑
↓→←↓↑↑↓→←↓↑→←→→↓
↑←→→←←→↑↓→→←←→→↑
↑↑↓ERDDUEREDENER
>>> puzzle.normalize('New Rules')
'NEWRULES'
>>> puzzle.arrows('New Rules')
'↑→←→↑←→↓'
>>> puzzle.isvalid('New Rules', row=3, col=2, direction='↓')
True
>>> puzzle.positions('New Rules')
{(3, 2, '↓')}
>>> print(puzzle.put('New Rules', row=3, col=2, direction='↓'))
→↓→→↓↓→↑↓↓↑→↓→↓↓
↓↓↓↑←↓→↑→↑↓↓→←←↓
←→↑→↓→←→↑↓←→↓→↑↑
→→N→↑↑↑→→→↑↑↑→→↓
↑←E→→↓↑→→→↑↓←→↑↑
←→W↓↑↑↓→→←→→↑→→↓
→→RWENDELLEREED↓
→↓U←→←←←→←←←→←←↑
↓→L↓↑↑↓→←↓↑→←→→↓
↑←E→←←→↑↓→→←←→→↑
↑↑SERDDUEREDENER
>>> puzzle.normalize('Underwurlde')
'UNDERWURLDE'
>>> puzzle.arrows('Underwurlde')
'↑↑↓→→←↑→←↓→'
>>> puzzle.isvalid('Underwurlde', row=10, col=0, direction='↑')
True
>>> puzzle.positions('Underwurlde')
{(10, 0, '↑')}
>>> print(puzzle.put('Underwurlde', row=10, col=0, direction='↑'))
E↓→→↓↓→↑↓↓↑→↓→↓↓
D↓↓↑←↓→↑→↑↓↓→←←↓
L→↑→↓→←→↑↓←→↓→↑↑
R→N→↑↑↑→→→↑↑↑→→↓
U←E→→↓↑→→→↑↓←→↑↑
W→W↓↑↑↓→→←→→↑→→↓
R→RWENDELLEREED↓
E↓U←→←←←→←←←→←←↑
D→L↓↑↑↓→←↓↑→←→→↓
N←E→←←→↑↓→→←←→→↑
U↑SERDDUEREDENER
>>> puzzle.positions('Eden')
{(0, 11, '↓'), (0, 13, '←'), (2, 5, '←'), (2, 11, '→')}
>>> puzzle.isvalid('Eden', row=3, col=5, direction='→')
False
>>> puzzle.put('Eden', row=3, col=5, direction='→')
Traceback (most recent call last):
AssertionError: invalid position
>>> print(puzzle)
E↓→→↓↓→↑↓↓↑→↓→↓↓
D↓↓↑←↓→↑→↑↓↓→←←↓
L→↑→↓→←→↑↓←→↓→↑↑
R→N→↑↑↑→→→↑↑↑→→↓
U←E→→↓↑→→→↑↓←→↑↑
W→W↓↑↑↓→→←→→↑→→↓
R→RWENDELLEREED↓
E↓U←→←←←→←←←→←←↑
D→L↓↑↑↓→←↓↑→←→→↓
N←E→←←→↑↓→→←←→→↑
U↑SERDDUEREDENER