Skip to content

Explain tricky borders like Spain - Morocco while solving - #12

Draft
atorch wants to merge 1 commit into
mainfrom
issue-9-tricky-border-hints
Draft

atorch wants to merge 1 commit into
mainfrom
issue-9-tricky-border-hints

Conversation

@atorch

@atorch atorch commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Addresses #9.

Why

Spain–Morocco (via Ceuta and Melilla) is on a shortest path in 890 of the 6,283 puzzles. Players who don't know about it get stuck, or wonder why the answer is right. Several other borders cause the same problem. Counting from graph_paths_subset.csv, at least one shortest path crosses one of the borders below in 2,461 puzzles.

What players see

  • Note on the route. When a route crosses one of these borders, a short italic note appears in the route between the arrow and the country just reached. For example: "Spain and Morocco share a land border: the Spanish cities of Ceuta and Melilla are on the North African coast." It stays on screen, which matters because toasts are cut off after two lines on Android 12 and later.
  • Hint when stuck. If a player makes 2 wrong guesses and every remaining shortest path leaves the current country through one of these borders, a hint appears above the input: "Hint: Morocco has a neighbour that's easy to overlook." It names the country they're in, not the answer. It shows at most once per step and clears on the next correct guess. Across all puzzles it can fire at 2,272 steps, mostly Morocco ↔ Spain.
  • Missing border. Guessing Mauritania from Morocco (or the reverse) explains that they don't share a border in this puzzle because Western Sahara lies between them. I checked the data: Morocco to Mauritania is a 3-country path through Algeria.

Borders included

Border Puzzles Why it surprises
Morocco – Spain 890 Ceuta and Melilla
Lithuania – Russia 674 Kaliningrad
Azerbaijan – Turkey 613 Nakhchivan
Afghanistan – China 361 The Wakhan Corridor
Norway – Russia 179 Far north
North Korea – Russia 139 Tumen River
Botswana – Zambia 86 Kazungula
Namibia – Zambia 79 The Caprivi Strip
France – Kingdom of the Netherlands 17 Saint Martin
Cyprus – United Kingdom 1 Akrotiri and Dhekelia

Left out on purpose:

  • Israel – Syria (Golan Heights): the wording would need care, and the border isn't really surprising.
  • Spain – Gibraltar: Gibraltar's only neighbour is Spain, so a player never has to find this border.

Code

  • res/values/tricky_borders.xml: the border list (Country A|Country B|Note), the missing-border list and the hint string. Adding a border only means adding a line here. The map review screen (Add an offline map screen: study, review, hint and answer modes #10) can reuse the list later.
  • TrickyBorders.java: loads the lists and looks up a pair in either order.
  • SolvePuzzle.java: tracks the current country and wrong guesses for the current step, adds the crossing notes (including the final crossing into the destination), and shows hints.
  • activity_solve_puzzle.xml: a hidden border_hint text line above the input.

Testing

  • A Python check confirms every name in tricky_borders.xml matches the countries array, and produced the counts above.
  • SolvePuzzle.java and TrickyBorders.java compile with javac against the Android 14 framework jar (Robolectric android-all), with stub AppCompat and R classes. The Android SDK isn't available in the environment where this was written, so this PR's CI run is the first full Gradle build.
  • TrickyBorders was run on the JVM against the real XML entries: lookups work in either order, apostrophes like "People's Republic of China" are handled, and the missing-border note appears only for the right pair.
  • Not yet run on a device. Check the note's look under the arrow and the hint after two wrong guesses. A Morocco ↔ Spain puzzle on Novice is the easiest case to test.

Notes


Generated by Claude Code

When a route crosses a border many players don't know about (Spain and
Morocco via Ceuta and Melilla, Turkey and Azerbaijan via Nakhchivan, the
Wakhan Corridor, and so on), add a short note to the route between the
arrow and the country just reached.

If a player makes two wrong guesses and every way forward crosses one of
those borders, show a hint naming the country they're in without giving
the answer away. Guessing Mauritania from Morocco (or the reverse)
explains that the puzzle has no border there because of Western Sahara.

The borders and notes live in res/values/tricky_borders.xml so the map
review screen can reuse them later.

Addresses #9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwXCdeWh35FYFQjdYfUWdv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants