butterfly_sudoku
Tags: sudoku
📖 Rule Reference: Read full rules on external site
🎮 Play Online: Janko
Input Format
1. Header Line [ROWS] [COLS]
Note: fixed [ROWS] and [COLS] as 12 x 12 for specific sudoku variant.
2. Grid Lines (Remaining [ROW] lines) The initial state of the grid rows.
Legend:
* -: empty (to be filled) cells;
* 1-9: Pre-filled number.
Output Format
Returns the sudoku-variant grid as a matrix of numbers, [ROWS] by [COLS].
Legend:
- -: forbidden cells (no number);
- 1-9: filled number.
Examples
Python Quick Start
Use the following code to solve this puzzle directly:
import puzzlekit
# Raw input data
problem_str = """
12 12
- 4 - - - 6 3 - - - 2 -
- 5 - - - - - - - - 6 -
- - - - 8 4 5 6 - - - -
8 - - 1 - - - - 7 - - 8
5 - - - - - - - - - - 2
- - - - 5 - - 4 - - - -
- - - - 2 - - 3 - - - -
4 - - - - - - - - - - 7
2 - - 4 - - - - 8 - - 3
- - - - 3 4 1 7 - - - -
- 1 - - - - - - - - 1 -
- 4 - - - 6 5 - - - 2 -
"""
# Solve
res = puzzlekit.solve(problem_str, puzzle_type="butterfly_sudoku")
# Print solution grid
print(res.solution_data.get('solution_grid', []))
# Visualize (optional)
res.show()