## About
This folder is for generating Numbrix puzzle questions and answers.

To generate the puzzles, you can run the `./run.sh` command.

## Folder Structure
- `./scripts/numbrix.py`: the core logic for generating Numbrix puzzles.
- `./scripts/numbrix_prompt.py`: the prompt templates for generating Numbrix puzzle questions.
- `./scripts/numbrix_verifier.py`: the verifier for validating Numbrix puzzle solutions.
- `./run.sh`: a script for generating Numbrix puzzles with various configurations.

## Game Rules
Numbrix is a logic puzzle where:
1. The goal is to fill a grid with numbers from 1 to n² (where n is the grid size).
2. Numbers that differ by 1 must be placed in orthogonally adjacent cells (sharing an edge).
3. The numbers must form a continuous path from 1 to n².
4. Some numbers are given as clues and cannot be changed.

## Parameters
The puzzle generator supports the following parameters:
- `n`: Size of the grid (n×n) (default: 5)
- `fill_rate`: Percentage of cells to be filled with clues (default: 0.3)
- `num_of_data`: Number of puzzles to generate (default: 100)
- `max_attempts`: Maximum attempts to generate a valid puzzle (default: 1000)

## PASSRATE
Current pass rates with DeepSeek-Reasoner:
- 6×6 grid, fill_rate=0.4: **0.7**
- 6×6 grid, fill_rate=0.3: **0.4**
- 7×7 grid, fill_rate=0.3: **0.5**
- 8×8 grid, fill_rate=0.3: **0.9**
- 9×9 grid, fill_rate=0.3: **0.4**
- 12×12 grid, fill_rate=0.3: **0.2**

Results with other models to be updated.