Пример #1
0
 def test_assemblePuzzle_fTest_knownGoodAssembly(self):
     d = tiles.Dealer(self.fTest)
     d.assemblePuzzle()
     matched = False
     for t in d.puzzle.spin():
         matched |= t.tile == self.knownPuzzleSolution
     self.assertTrue(matched)
Пример #2
0
 def test_assemblePuzzle_fInput_dims(self):
     d = tiles.Dealer(self.fInput)
     tileDims = d.tiles[0].dims
     puzzleDims = d.dims
     finalDims = ((tileDims[0] - 2) * puzzleDims[0],
                  (tileDims[1] - 2) * puzzleDims[1])
     d.assemblePuzzle()
     self.assertEqual(finalDims, d.puzzle.dims)
Пример #3
0
 def test_findSerpents_fInput_count(self):
     d = tiles.Dealer(self.fInput)
     d.assemblePuzzle()
     self.assertEqual(21, len(d.findSerpents()))
Пример #4
0
 def test_assemblePuzzle_fInput_count(self):
     d = tiles.Dealer(self.fInput)
     d.assemblePuzzle()
     self.assertEqual(1922, d.puzzle.countSymbol('#'))
Пример #5
0
 def test_assemblePuzzle_fTest_count(self):
     d = tiles.Dealer(self.fTest)
     d.assemblePuzzle()
     self.assertEqual(303, d.puzzle.countSymbol('#'))
Пример #6
0
 def test_init_corners_fTest(self):
     d = tiles.Dealer(self.fTest)
     self.assertEqual(20899048083289, d.calculateCornerMultiple())
Пример #7
0
 def test_init_corners_fInput(self):
     d = tiles.Dealer(self.fInput)
     self.assertEqual(45443966642567, d.calculateCornerMultiple())
Пример #8
0
 def test_init_fTest_dims(self):
     d = tiles.Dealer(self.fTest)
     self.assertEqual(9, d.count)
     self.assertEqual((3, 3), d.dims)