Skip to content

regional_yajilin

Tags: loop

📖 Rule Reference: Read full rules on external site

🎮 Play Online: Play at puzz.link • janko


Input Format

TBD

Output Format

Returns a grid with nswe format representing the path segments of the single continuous loop.

Cell Format:

Each non-empty cell contains a string of characters indicating the directions of the path passing through it.

  • n: North (Up)
  • s: South (Down)
  • w: West (Left)
  • e: East (Right)

Examples:

  • ns: A vertical line segment (North-South).
  • ne: A 90-degree turn connecting North and East.
  • -: Empty cell (not part of the loop).
  • x: Filled cell (not appear if no rule applies, e.g., masyu).

Examples

Python Quick Start

Use the following code to solve this puzzle directly:

import puzzlekit

# Raw input data
problem_str = """
8 8
1 - - - - - 1 -
- - - - - - - -
- 2 - - - - - -
- - - - - - - -
- - - - - - - -
- - 2 - - - - -
- - - - - 0 - -
- - - - - - - -
1 1 2 2 2 2 6 7
1 2 2 2 2 2 6 6
2 3 3 2 2 2 2 2
2 3 3 2 2 2 2 2
2 2 2 2 2 2 2 2
2 2 4 4 4 2 2 2
2 2 2 2 2 5 5 5
2 2 2 2 2 5 5 5
"""

# Solve
res = puzzlekit.solve(problem_str, puzzle_type="regional_yajilin")

# Print solution grid
print(res.solution_data.get('solution_grid', []))

# Visualize (optional)
res.show()

Solution Output

8 8
x se ew ew ew ew ew sw
se nw se ew ew sw x ns
ns x ne sw x ne sw ns
ne sw x ne sw x ns ns
x ne ew sw ne sw ne nw
se sw x ns x ne sw x
ns ne ew nw se sw ne sw
ne ew ew ew nw ne ew nw