Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
 def test_findSerpents_fInput_count(self):
     d = tiles.Dealer(self.fInput)
     d.assemblePuzzle()
     self.assertEqual(21, len(d.findSerpents()))
Ejemplo n.º 4
0
 def test_assemblePuzzle_fInput_count(self):
     d = tiles.Dealer(self.fInput)
     d.assemblePuzzle()
     self.assertEqual(1922, d.puzzle.countSymbol('#'))
Ejemplo n.º 5
0
 def test_assemblePuzzle_fTest_count(self):
     d = tiles.Dealer(self.fTest)
     d.assemblePuzzle()
     self.assertEqual(303, d.puzzle.countSymbol('#'))
Ejemplo n.º 6
0
 def test_init_corners_fTest(self):
     d = tiles.Dealer(self.fTest)
     self.assertEqual(20899048083289, d.calculateCornerMultiple())
Ejemplo n.º 7
0
 def test_init_corners_fInput(self):
     d = tiles.Dealer(self.fInput)
     self.assertEqual(45443966642567, d.calculateCornerMultiple())
Ejemplo n.º 8
0
 def test_init_fTest_dims(self):
     d = tiles.Dealer(self.fTest)
     self.assertEqual(9, d.count)
     self.assertEqual((3, 3), d.dims)