Exemple #1
0
def test_naked_multi_4() -> None:
    quad_board = naked_multi_board_1.copy()

    quad_board['A1'] = quad_board['A1'] + '2'  # give it a 2 to clear
    quad_board['A5'] = quad_board['A5'] + '2'  # give it a 2 to clear
    quad_board['F1'] = quad_board['F1'] + '1'  # give it a 1 to clear

    sbrd = SB()
    board = sbrd.naked_multi(quad_board, 4)
    assert board == naked_multi_board_1
Exemple #2
0
def test_naked_multi_3() -> None:
    """Solve first naked twin board with naked triplets"""
    triplet_board = naked_multi_board_1.copy()

    triplet_board['A5'] = triplet_board['A5'] + '3'  # give it a 3 to clear
    triplet_board['I2'] = triplet_board['I2'] + '7'  # give it a 7 to clear
    triplet_board['G2'] = triplet_board['G2'] + '3'  # give it a 3 to clear

    sbrd = SB()
    board = sbrd.naked_multi(triplet_board, 3)
    assert board == naked_multi_board_1
Exemple #3
0
def test_naked_multi_4() -> None:
    """Solve first naked twin board with naked quads"""
    quad_board = naked_multi_board_1.copy()

    # add some numbers to the board that the existing quads can clear
    quad_board['A1'] = quad_board['A1'] + '2'  # give it a 2 to clear
    quad_board['A5'] = quad_board['A5'] + '2'  # give it a 2 to clear
    quad_board['F1'] = quad_board['F1'] + '1'  # give it a 1 to clear

    sbrd = SB()
    board = sbrd.naked_multi(quad_board, 4)
    assert board == naked_multi_board_1
Exemple #4
0
def test_naked_multi_3() -> None:
    """Solve first naked twin board with naked triplets"""
    triplet_board = naked_multi_board_1.copy()

    # add some numbers to the board that the existing triples can clear
    triplet_board['A5'] = triplet_board['A5'] + '3'  # give it a 3 to clear
    triplet_board['I2'] = triplet_board['I2'] + '7'  # give it a 7 to clear
    triplet_board['G2'] = triplet_board['G2'] + '3'  # give it a 3 to clear

    sbrd = SB()
    board = sbrd.naked_multi(triplet_board, 3)
    assert board == naked_multi_board_1
Exemple #5
0
def test_naked_multi_2() -> None:
    """Solve first naked twin problem with naked multi twins"""
    sbrd = SB()
    board = sbrd.naked_multi(naked_multi_board_1, 2)
    assert board in naked_multi_solutions_1