def test_covering_n_solutions(self): B = covering.Board([8,8],{'[3, 3]': 0,'[3, 4]': 0,'[4, 3]': 0,'[4, 4]': 0}) C = covering.Covering(B,pentominos.TileSet(pentominos.all_pentominos()),{'X': [[[0,2],[1,2],[1,1],[1,3],[2,2]]]}) self.assertEqual(19, C.n_solutions()) C = covering.Covering(B,pentominos.TileSet(pentominos.all_pentominos()),{'X': [[[0,3],[1,3],[1,2],[1,4],[2,3]]]}) self.assertEqual(20, C.n_solutions()) C = covering.Covering(B,pentominos.TileSet(pentominos.all_pentominos()),{'X': [[[1,2],[2,2],[2,1],[2,3],[3,2]]]}) self.assertEqual(26, C.n_solutions())
def test_fixed_pentominos(self): orbitSize = dict() for p in pentominos.all_pentominos(): orbitSize[p.name] = pentominos.fixed_pentominos_of(p).size() self.assertEqual(dict({'F': 8, 'I': 2, 'L': 8, 'N': 8, 'P': 8, 'U': 4, 'T': 4, 'W': 4, 'V': 4, 'Y': 8, 'X': 1, 'Z': 4}), orbitSize) self.assertEqual(pentominos.all_fixed_pentominos().size(), 63)
def test_fixed_pentominos(self): orbitSize = dict() for p in pentominos.all_pentominos(): orbitSize[p.name] = pentominos.fixed_pentominos_of(p).size() self.assertEqual(dict({'F': 8, 'I': 2, 'L': 8, 'N': 8, 'P': 8, 'U': 4, 'T': 4, 'W': 4, 'V': 4, 'Y': 8, 'X': 1, 'Z': 4}), orbitSize) self.assertEqual(pentominos.all_fixed_pentominos().size(), 63)
def test_covering_n_solutions(self): B = covering.Board([8, 8], { '[3, 3]': 0, '[3, 4]': 0, '[4, 3]': 0, '[4, 4]': 0 }) C = covering.Covering( B, pentominos.TileSet(pentominos.all_pentominos()), {'X': [[[0, 2], [1, 2], [1, 1], [1, 3], [2, 2]]]}) self.assertEqual(19, C.n_solutions()) C = covering.Covering( B, pentominos.TileSet(pentominos.all_pentominos()), {'X': [[[0, 3], [1, 3], [1, 2], [1, 4], [2, 3]]]}) self.assertEqual(20, C.n_solutions()) C = covering.Covering( B, pentominos.TileSet(pentominos.all_pentominos()), {'X': [[[1, 2], [2, 2], [2, 1], [2, 3], [3, 2]]]}) self.assertEqual(26, C.n_solutions())
def test_normalize(self): for p in pentominos.all_pentominos(): self.assertEqual(p.coos, p.normalize().coos, "test_normalize failed for polyomino " + p.name)
def test_normalize(self): for p in pentominos.all_pentominos(): self.assertEqual(p.coos, p.normalize().coos, "test_normalize failed for polyomino " + p.name)
def initializeTheIncidenceMatrix(self): allPentos=pentominos.all_pentominos() for p in allPentos: self.insertAllPlacements(p)
def test_normalize(self): for p in pentominos.all_pentominos(): print(p.representation()) self.assertEqual(p.coos, p.normalize().coos, "test_normalize failed for polyomino " + p.name)
def initializeIncidenceMatrix(self): for p in pentominos.all_pentominos(): self.appendPentominoRows(p) print(str(self.rows))
def initializeIncidenceMatrix(self): for p in pentominos.all_pentominos(): self.appendPentominoRows(p) print(str(self.rows))
def initializeTheIncidenceMatrix(self): allPentos = pentominos.all_pentominos() for p in allPentos: self.insertAllPlacements(p)