Exemplo n.º 1
0
    def test_nine_extensions(self):
        big = SudokuPuzzle([
            ['E', 'C', '', '', 'G', '', '', '', ''],
            ['F', '', '', 'A', 'I', 'E', '', '', ''],
            ['', 'I', 'H', '', '', '', '', 'F', ''],
            ['H', '', '', '', 'F', '', '', '', 'C'],
            ['D', '', '', 'H', '', 'C', '', '', 'A'],
            ['G', '', '', '', 'B', '', '', '', 'F'],
            ['', 'F', '', '', '', '', 'B', 'H', ''],
            ['', '', '', 'D', 'A', 'I', '', '', 'E'],
            ['', '', '', '', 'H', '', '', 'G', 'I']])

        self.assertEqual(big._possible_letters(4, 4),
                         ['E'])
        self.assertEqual(big._possible_letters(3, 3),
                         ['E', 'G', 'I'])
Exemplo n.º 2
0
    def test_nine_extensions(self):
        big = SudokuPuzzle([['E', 'C', '', '', 'G', '', '', '', ''],
                            ['F', '', '', 'A', 'I', 'E', '', '', ''],
                            ['', 'I', 'H', '', '', '', '', 'F', ''],
                            ['H', '', '', '', 'F', '', '', '', 'C'],
                            ['D', '', '', 'H', '', 'C', '', '', 'A'],
                            ['G', '', '', '', 'B', '', '', '', 'F'],
                            ['', 'F', '', '', '', '', 'B', 'H', ''],
                            ['', '', '', 'D', 'A', 'I', '', '', 'E'],
                            ['', '', '', '', 'H', '', '', 'G', 'I']])

        self.assertEqual(big._possible_letters(4, 4), ['E'])
        self.assertEqual(big._possible_letters(3, 3), ['E', 'G', 'I'])
Exemplo n.º 3
0
 def test_sample3(self):
     s = SudokuPuzzle([['A', 'B', '', 'D'],
                       ['C', 'D', '', 'B'],
                       ['B', '', '', ''],
                       ['D', '', 'A', '']])
     self.assertEqual(s._possible_letters(2, 3), ['C'])
Exemplo n.º 4
0
 def test_sample3(self):
     s = SudokuPuzzle([['A', 'B', '', 'D'], ['C', 'D', '', 'B'],
                       ['B', '', '', ''], ['D', '', 'A', '']])
     self.assertEqual(s._possible_letters(2, 3), ['C'])