示例#1
0
 def test_3x3_with_random_walls(self):
     board = [
         [0, 0, 0],
         [0, 1, 1],
         [1, 0, 0],
     ]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#2
0
 def test_3x3_second_column_blocked(self):
     board = [
         [0, 1, 0],
         [0, 1, 0],
         [0, 1, 0],
     ]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#3
0
 def test_3x3_diagonal_blocked(self):
     board = [
         [0, 0, 1],
         [0, 1, 0],
         [1, 0, 0],
     ]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#4
0
 def test_3x3_second_line_blocked(self):
     board = [
         [0, 0, 0],
         [1, 1, 1],
         [0, 0, 0],
     ]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#5
0
 def test_cops_from_uri(self):
     board = [
         [0, 0, 0, 0, 1],
         [1, 1, 0, 0, 1],
         [0, 1, 0, 0, 0],
         [0, 0, 0, 1, 1],
         [1, 1, 0, 0, 0],
     ]
     self.assertEqual(cops_and_robbers(board), 'cops')
示例#6
0
 def test_5x5_with_random_walls_cops_U(self):
     board = [
         [0, 1, 0, 0, 0],
         [0, 1, 0, 1, 0],
         [0, 1, 0, 1, 0],
         [0, 1, 0, 1, 0],
         [0, 0, 0, 1, 0],
     ]
     self.assertEqual(cops_and_robbers(board), 'cops')
示例#7
0
 def test_one_single_free_space(self):
     board = [[0]]
     self.assertEqual(cops_and_robbers(board), 'cops')
示例#8
0
 def test_2x2_without_way_to_robbers_on_first_line(self):
     board = [[1, 0], [0, 0]]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#9
0
 def test_2x2_without_way_to_robbers(self):
     board = [[0, 1], [1, 0]]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#10
0
 def test_2x2_last_space_busy(self):
     board = [[0, 0], [0, 1]]
     self.assertEqual(cops_and_robbers(board), 'robbers')
示例#11
0
 def test_non_free_space(self):
     board = [[1]]
     self.assertEqual(cops_and_robbers(board), 'robbers')