setup
Initialize crossword puzzle state by loading grid layout and clue definitions to prepare for solving. Accepts grid text with cell positions and JSON-formatted clues for across and down directions.
Instructions
クロスワードの盤面とカギ定義を読み込み、状態を初期化する。
Args:
grid_text (str): 行番号つきの盤面テキスト。列・行番号は全角数字で表記し、
文字が入るマスは "?"、黒マスは "#" で記述する。各行のマス数が一致している
必要がある。
clue_text (str): JSON Lines 形式のカギ定義。各行は id/direction/row/col
/length/clue を持つ辞書で、direction は "across" か "down"。row と
col は 1 起点の正整数。
Returns: list[list[str]]: 正規化済みセル行列。各要素は "?" または "#" のシンボル。
Raises: ValueError: 盤面の行長不一致・未知のセル記号・カギ定義の欠損や不正値など、 入力内容が検証に失敗した場合。
Notes: この関数を呼び出すと既存の候補リストは破棄され、状態が再初期化される。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clue_text | Yes | ||
| grid_text | Yes |