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

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

## Folder Structure
- `./scripts/kukurasu.py`: the core logic for generating Kukurasu puzzles.
- `./scripts/kukurasu_prompt.py`: the prompt templates for generating Kukurasu puzzle questions.
- `./scripts/kukurasu_verifier.py`: the verifier for validating Kukurasu puzzle solutions.
- `./run.sh`: a script for generating Kukurasu puzzles with various configurations.

## Game Rules
Kukurasu is a logic puzzle where:
1. Each cell in the grid must contain either a "1" or an "X".
2. The weight of a "1" in a row is its column position (1-indexed).
3. The weight of a "1" in a column is its row position (1-indexed).
4. The weighted sum of each row and column must match the given constraints.

## Parameters
The puzzle generator supports the following parameters:
- `n`: Number of rows in the grid (default: 4)
- `m`: Number of columns in the grid (default: 4)
- `ones_probability`: Probability of placing a "1" in the solution grid (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:
- 4×4 grid, ones_probability=0.3: **1.0**
- 4×4 grid, ones_probability=0.4: **0.9**
- 6×6 grid, ones_probability=0.3: **0.5**
- 5×5 grid, ones_probability=0.3: **0.9**
- 8×8 grid, ones_probability=0.5: **0.0**

Other results to be updated.