#!/usr/bin/env python3

import importlib
ssl = importlib.import_module('sudoku-solver-logic')

# =============================================================================
Build3x3IndexedThermos = ssl.SquareSudokuPuzzle(
    3,
    "Blank 3x3 sudoku to build Indexed Thermos",
    #'''
        #2..9.1..3 # To test the distributed solver fast-ish
        #7........
        #8........
        #.........
        #5.......1
        #.........
        #.........
        #.........
        #3..8.2..4
    #''',
    #'''
        #2..9.1..3 # To test the distributed solver fast-ish
        #7.......9
        #8.......6
        #.........
        #5.......1
        #.........
        #.........
        #.........
        #3..8.2..4
    #''',
    #'''
        #3.......4
        #6.......5
        #5.......7
        #7.......6
        #8.......9
        #9.......8
        #1.......2
        #2.......1
        #4.......3
    #''',
    {},
    {
        'IndexedThermos':   {
            'Constraints': [ssl.IndexedThermo,],
            'Sets': {
                **{r: [(r, c) for c in ssl.Standard3x3SudokuGrid.columns] for r in ssl.Standard3x3SudokuGrid.rows},
                **{c+ssl.Standard3x3SudokuGrid.size: [(r, c) for r in ssl.Standard3x3SudokuGrid.rows] for c in ssl.Standard3x3SudokuGrid.columns}
            }
        },
        'IndexedThermosNonOverlapping':   {
            'Constraints': [ssl.Standard3x3SudokuGrid.IndexedThermosValidation,],
            'Sets': {
                1: [
                    *[(r, 1) for r in ssl.Standard3x3SudokuGrid.rows],
                    *[(r, ssl.Standard3x3SudokuGrid.size) for r in ssl.Standard3x3SudokuGrid.rows],
                    *[(1, c) for c in ssl.Standard3x3SudokuGrid.columns],
                    *[(ssl.Standard3x3SudokuGrid.size, c) for c in ssl.Standard3x3SudokuGrid.columns],
                ]
            }
        },
    },
    {},
    debug = 0, #debug,
    debug_step = 0, #debug_step,
)

Build3x3IndexedThermos.BuildIndexedThermos(0, 11, 'C')
#Build3x3IndexedThermos.BuildIndexedThermos(0, 5, 'C')
#Build3x3IndexedThermos.BuildIndexedThermos(3, 3, 'C')
#Build3x3IndexedThermos.BuildIndexedThermos(1, 1, 'C')
