Exemplo n.º 1
0
 def test_check_board_failure_incomplete(self):
     a = [[7, 2, 5, 3, 8, 6, 9, 1, 4], [8, 4, 3, 1, 2, 9, 7, 5, 6],
          [9, 6, 1, 2, 7, 4, 3, 8, 2], [4, 3, 9, 2, 5, 1, 8, 6, 7],
          [1, 7, 0, 4, 6, 8, 5, 3, 9], [6, 5, 8, 7, 9, 3, 2, 4, 1],
          [5, 9, 6, 8, 4, 7, 1, 2, 3], [3, 8, 7, 6, 1, 2, 4, 9, 5],
          [2, 1, 4, 9, 3, 5, 6, 7, 8]]
     result = sm.check_board(a)
     self.assertEqual(result, (0, 1))
Exemplo n.º 2
0
 def test_check_board_complete_success(self):
     a = [[7, 2, 5, 3, 8, 6, 9, 1, 4], [8, 4, 3, 1, 2, 9, 7, 5, 6],
          [9, 6, 1, 5, 7, 4, 3, 8, 2], [4, 3, 9, 2, 5, 1, 8, 6, 7],
          [1, 7, 2, 4, 6, 8, 5, 3, 9], [6, 5, 8, 7, 9, 3, 2, 4, 1],
          [5, 9, 6, 8, 4, 7, 1, 2, 3], [3, 8, 7, 6, 1, 2, 4, 9, 5],
          [2, 1, 4, 9, 3, 5, 6, 7, 8]]
     result = sm.check_board(a)
     self.assertEqual(result, (1, 0))