예제 #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)